Skip to content

Commit

Permalink
Fix first letter in chatbox moving player
Browse files Browse the repository at this point in the history
Fix part of issue MovingBlocks#2833 (Various isses with movement inputs persisting
through the chatbox) where the first letter typed into an empty chatbox was
causing the player to move.

This was caused by the event falling through to the normal event system,
because a path was not marked with eventHandled = true.
  • Loading branch information
Vizaxo committed Mar 19, 2017
1 parent 7e3ba2c commit 08db229
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ public boolean onKeyEvent(NUIKeyEvent event) {
String after = fullText.substring(Math.max(getCursorPosition(), selectionStart));
setText(before + event.getKeyCharacter() + after);
setCursorPosition(Math.min(getCursorPosition(), selectionStart) + 1);
eventHandled = true;
}
} else {
String fullText = text.get();
Expand Down

0 comments on commit 08db229

Please sign in to comment.