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;
|
||||
}
|
||||
|
||||
@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
|
||||
public class ChatKeyboardListener implements KeyListener
|
||||
{
|
||||
@Inject
|
||||
private ChatCommandsConfig chatCommandsConfig;
|
||||
|
||||
@Inject
|
||||
private Client client;
|
||||
|
||||
@@ -50,7 +53,7 @@ public class ChatKeyboardListener implements KeyListener
|
||||
@Override
|
||||
public void keyPressed(KeyEvent e)
|
||||
{
|
||||
if (!e.isControlDown())
|
||||
if (!e.isControlDown() || !chatCommandsConfig.clearShortcuts())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user