chat commands: add config setting for chat clear shortcuts

This commit is contained in:
Adam
2018-06-25 18:23:31 -04:00
parent 8247163fee
commit 58404f098d
2 changed files with 15 additions and 1 deletions

View File

@@ -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;
}
} }

View File

@@ -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;
} }