From c22ae453c2ff5fff946c513d5cdd245450eaeb1c Mon Sep 17 00:00:00 2001 From: LlemonDuck Date: Wed, 11 May 2022 23:18:26 -0400 Subject: [PATCH] chatcommands: consume "clear single word" keypress Prevents a binding of "Ctrl+Backspace" from triggering the "clear single word" and also removing the remaining trailing space. Closes #14941 --- .../client/plugins/chatcommands/ChatKeyboardListener.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatKeyboardListener.java b/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatKeyboardListener.java index 69456fd861..bad417e02d 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatKeyboardListener.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatKeyboardListener.java @@ -65,6 +65,9 @@ public class ChatKeyboardListener implements KeyListener if (input != null) { + // prevent the keypress from also modifying the chatbox as we alter the text + e.consume(); + // remove trailing space while (input.endsWith(" ")) { @@ -80,6 +83,7 @@ public class ChatKeyboardListener implements KeyListener } else if (chatCommandsConfig.clearChatBox().matches(e)) { + e.consume(); int inputTye = client.getVar(VarClientInt.INPUT_TYPE); clientThread.invoke(() -> applyText(inputTye, "")); }