mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-14 23:28:52 -04:00
Add a verification layer for the gamepad.
This commit is contained in:
parent
00435f2fd7
commit
9aea2065ce
@ -265,8 +265,10 @@ public class Gamepad {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isGamepadEvent(KeyEvent event){
|
public static boolean isGamepadEvent(KeyEvent event){
|
||||||
return ((event.getDevice().getSources() & InputDevice.SOURCE_GAMEPAD) == InputDevice.SOURCE_GAMEPAD
|
boolean isGamepad = ((event.getSource() & InputDevice.SOURCE_GAMEPAD) == InputDevice.SOURCE_GAMEPAD)
|
||||||
&& GamepadDpad.isDpadEvent(event) );
|
|| ((event.getDevice() != null) && ((event.getDevice().getSources() & InputDevice.SOURCE_GAMEPAD) == InputDevice.SOURCE_GAMEPAD));
|
||||||
|
|
||||||
|
return isGamepad && GamepadDpad.isDpadEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user