mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-16 10:44:45 +00:00
Simplify the keybinding (#982)
This commit is contained in:
1 parent
2c204c25aa
commit
2b28068382
6 files changed
+24
-22
No files matched your search
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user