mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-16 08:05:34 -04:00
Fix a crash in gamepadEvent detection
This commit is contained in:
parent
d95112d5ff
commit
84490ec5a7
@ -25,6 +25,7 @@ import static net.kdt.pojavlaunch.customcontrols.gamepad.GamepadJoystick.DIRECTI
|
||||
import static net.kdt.pojavlaunch.customcontrols.gamepad.GamepadJoystick.DIRECTION_SOUTH_EAST;
|
||||
import static net.kdt.pojavlaunch.customcontrols.gamepad.GamepadJoystick.DIRECTION_SOUTH_WEST;
|
||||
import static net.kdt.pojavlaunch.customcontrols.gamepad.GamepadJoystick.DIRECTION_WEST;
|
||||
import static net.kdt.pojavlaunch.customcontrols.gamepad.GamepadJoystick.isJoystickEvent;
|
||||
|
||||
public class Gamepad {
|
||||
|
||||
@ -381,9 +382,12 @@ public class Gamepad {
|
||||
|
||||
}
|
||||
|
||||
public static boolean isGamepadEvent(InputEvent event){
|
||||
public static boolean isGamepadEvent(MotionEvent event){
|
||||
return isJoystickEvent(event);
|
||||
}
|
||||
|
||||
public static boolean isGamepadEvent(KeyEvent event){
|
||||
return ((event.getSource() & InputDevice.SOURCE_GAMEPAD) == InputDevice.SOURCE_GAMEPAD
|
||||
|| GamepadJoystick.isJoystickEvent((MotionEvent) event)
|
||||
|| GamepadDpad.isDpadEvent(event));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user