mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Android: Prioritize PAD devices.
This commit is contained in:
parent
14bf5de83c
commit
460ceadcc3
1 changed files with 6 additions and 4 deletions
|
@ -28,13 +28,15 @@ public class InputDeviceState {
|
||||||
|
|
||||||
public InputDeviceState(InputDevice device) {
|
public InputDeviceState(InputDevice device) {
|
||||||
int sources = device.getSources();
|
int sources = device.getSources();
|
||||||
if ((sources & InputDevice.SOURCE_KEYBOARD) == InputDevice.SOURCE_KEYBOARD && device.getKeyboardType() == InputDevice.KEYBOARD_TYPE_ALPHABETIC) {
|
// First, anything that's a gamepad is a gamepad, even if it has a keyboard or pointer.
|
||||||
|
if ((sources & InputDevice.SOURCE_GAMEPAD) == InputDevice.SOURCE_GAMEPAD) {
|
||||||
|
this.deviceId = NativeApp.DEVICE_ID_PAD_0;
|
||||||
|
} else if ((sources & InputDevice.SOURCE_KEYBOARD) == InputDevice.SOURCE_KEYBOARD && device.getKeyboardType() == InputDevice.KEYBOARD_TYPE_ALPHABETIC) {
|
||||||
this.deviceId = NativeApp.DEVICE_ID_KEYBOARD;
|
this.deviceId = NativeApp.DEVICE_ID_KEYBOARD;
|
||||||
} else if ((sources & InputDevice.SOURCE_CLASS_POINTER) == InputDevice.SOURCE_CLASS_POINTER) {
|
} else if ((sources & InputDevice.SOURCE_CLASS_POINTER) == InputDevice.SOURCE_CLASS_POINTER) {
|
||||||
this.deviceId = NativeApp.DEVICE_ID_MOUSE;
|
this.deviceId = NativeApp.DEVICE_ID_MOUSE;
|
||||||
} else if (((sources & InputDevice.SOURCE_GAMEPAD) == InputDevice.SOURCE_GAMEPAD ||
|
} else if ((sources & InputDevice.SOURCE_JOYSTICK) == InputDevice.SOURCE_JOYSTICK ||
|
||||||
(sources & InputDevice.SOURCE_JOYSTICK) == InputDevice.SOURCE_JOYSTICK ||
|
(sources & InputDevice.SOURCE_DPAD) == InputDevice.SOURCE_DPAD) {
|
||||||
(sources & InputDevice.SOURCE_DPAD) == InputDevice.SOURCE_DPAD)) {
|
|
||||||
this.deviceId = NativeApp.DEVICE_ID_PAD_0;
|
this.deviceId = NativeApp.DEVICE_ID_PAD_0;
|
||||||
} else {
|
} else {
|
||||||
// Built-in buttons like Back etc.
|
// Built-in buttons like Back etc.
|
||||||
|
|
Loading…
Add table
Reference in a new issue