v1.2.1: added support for binding mouse 4 and 5 to game actions

This commit is contained in:
Evan Debenham
2022-03-30 16:10:19 -04:00
parent aa2e012fa4
commit e63b5a208c
3 changed files with 27 additions and 4 deletions

View File

@@ -50,7 +50,7 @@ public class KeyBindings {
public static boolean bindingKey = false;
public static boolean isKeyBound(int keyCode){
if (keyCode <= 0 || keyCode > 255){
if (keyCode < 0 || (keyCode > 255 && keyCode < 1000)){
return false;
}
return bindingKey || bindings.containsKey( keyCode ) || hardBindings.containsKey( keyCode );
@@ -80,6 +80,13 @@ public class KeyBindings {
return ControllerHandler.customButtonName(keyCode);
}
//custom codes for mouse buttons
if (keyCode == 1003){
return "Mouse 4";
} else if (keyCode == 1004) {
return "Mouse 5";
}
if (keyCode == Input.Keys.UNKNOWN){
return "None";
} else if (keyCode == Input.Keys.PLUS){