Simplify the keybinding (#982)

This commit is contained in:
slprime authored and GitHub committed 2026-07-25 02:14:12 +03:00
1 parent 2c204c25aa
commit 2b28068382
6 files changed
+24 -22

No files matched your search

+10 -8
View File
@@ -67,17 +67,19 @@ public class KeyManager {
}
public static boolean isKeyDown(String ident) {
final int keyCode = getKeyCode(ident);
final KeyBinding binding = getKeyBinding(ident);
if (keyCode == Keyboard.KEY_NONE) {
return false;
if (binding != null) {
final int keyCode = binding.getKeyCode();
if (keyCode < 0) {
return Mouse.isButtonDown(keyCode + 100);
} else if (keyCode > Keyboard.KEY_NONE && keyCode < Keyboard.KEYBOARD_SIZE) {
return Keyboard.isKeyDown(keyCode);
}
}
if (keyCode < 0) {
return Mouse.isButtonDown(keyCode + 100);
}
return keyCode < Keyboard.KEYBOARD_SIZE && Keyboard.isKeyDown(keyCode);
return false;
}
public static boolean isHashDown(String ident) {