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
This commit is contained in:
@@ -65,6 +65,9 @@ public class ChatKeyboardListener implements KeyListener
|
|||||||
|
|
||||||
if (input != null)
|
if (input != null)
|
||||||
{
|
{
|
||||||
|
// prevent the keypress from also modifying the chatbox as we alter the text
|
||||||
|
e.consume();
|
||||||
|
|
||||||
// remove trailing space
|
// remove trailing space
|
||||||
while (input.endsWith(" "))
|
while (input.endsWith(" "))
|
||||||
{
|
{
|
||||||
@@ -80,6 +83,7 @@ public class ChatKeyboardListener implements KeyListener
|
|||||||
}
|
}
|
||||||
else if (chatCommandsConfig.clearChatBox().matches(e))
|
else if (chatCommandsConfig.clearChatBox().matches(e))
|
||||||
{
|
{
|
||||||
|
e.consume();
|
||||||
int inputTye = client.getVar(VarClientInt.INPUT_TYPE);
|
int inputTye = client.getVar(VarClientInt.INPUT_TYPE);
|
||||||
clientThread.invoke(() -> applyText(inputTye, ""));
|
clientThread.invoke(() -> applyText(inputTye, ""));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user