Add custom char mappings to Esc&Backspace to prevent them typing in chars into textboxes

This commit is contained in:
Raven Szewczyk committed 2023-03-10 20:03:34 +00:00
1 parent 81c13b7b0b
commit 8dadeb51d3
2 files changed
+11 -5

No files matched your search

+7 -1
View File
@@ -295,7 +295,13 @@ public class Keyboard {
}
public static char getEventCharacter() {
return keyEventChars[getEventKey()];
final int eventKey = getEventKey();
// On some systems it seems esc and backspace can generate broken chars sometimes, make sure they always work
return switch (eventKey) {
case KEY_ESCAPE -> '\0';
case KEY_BACK -> '\b';
default -> keyEventChars[eventKey];
};
}
public static boolean getEventKeyState() {