chat commands: add config setting for chat clear shortcuts
This commit is contained in:
@@ -67,4 +67,15 @@ public interface ChatCommandsConfig extends Config
|
|||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ConfigItem(
|
||||||
|
position = 3,
|
||||||
|
keyName = "clearShortcuts",
|
||||||
|
name = "Clear shortcuts",
|
||||||
|
description = "Enable shortcuts (ctrl+w and backspace) for clearing the chatbox"
|
||||||
|
)
|
||||||
|
default boolean clearShortcuts()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,6 +35,9 @@ import net.runelite.client.input.KeyListener;
|
|||||||
@Singleton
|
@Singleton
|
||||||
public class ChatKeyboardListener implements KeyListener
|
public class ChatKeyboardListener implements KeyListener
|
||||||
{
|
{
|
||||||
|
@Inject
|
||||||
|
private ChatCommandsConfig chatCommandsConfig;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private Client client;
|
private Client client;
|
||||||
|
|
||||||
@@ -50,7 +53,7 @@ public class ChatKeyboardListener implements KeyListener
|
|||||||
@Override
|
@Override
|
||||||
public void keyPressed(KeyEvent e)
|
public void keyPressed(KeyEvent e)
|
||||||
{
|
{
|
||||||
if (!e.isControlDown())
|
if (!e.isControlDown() || !chatCommandsConfig.clearShortcuts())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user