mirror of
https://github.com/GTNewHorizons/lwjgl3ify.git
synced 2026-11-23 21:50:05 +00:00
Add custom char mappings to Esc&Backspace to prevent them typing in chars into textboxes
This commit is contained in:
1 parent
81c13b7b0b
commit
8dadeb51d3
2 files changed
+11
-5
No files matched your search
@@ -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() {
|
||||
|
||||
Reference in new issue
Block a user