mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-19 19:13:03 +00:00
Fix issue with ipega controller not capturing keypresses on Samsung phones. (#386)
This commit is contained in:
parent
e7d96f0ac2
commit
043c9a978e
@ -575,8 +575,13 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
|||||||
}
|
}
|
||||||
|
|
||||||
boolean handled = false;
|
boolean handled = false;
|
||||||
if (event.getDevice() == null ||
|
|
||||||
event.getDevice().getKeyboardType() != InputDevice.KEYBOARD_TYPE_ALPHABETIC) {
|
boolean detectedGamepad = event.getDevice() == null ? false :
|
||||||
|
((event.getDevice().getSources() & InputDevice.SOURCE_JOYSTICK) != 0 ||
|
||||||
|
(event.getDevice().getSources() & InputDevice.SOURCE_GAMEPAD) != 0);
|
||||||
|
if (detectedGamepad || (event.getDevice() == null ||
|
||||||
|
event.getDevice().getKeyboardType() != InputDevice.KEYBOARD_TYPE_ALPHABETIC
|
||||||
|
)) {
|
||||||
// Always try the controller handler first, unless it's an alphanumeric keyboard device.
|
// Always try the controller handler first, unless it's an alphanumeric keyboard device.
|
||||||
// Otherwise, controller handler will eat keyboard d-pad events.
|
// Otherwise, controller handler will eat keyboard d-pad events.
|
||||||
handled = controllerHandler.handleButtonDown(event);
|
handled = controllerHandler.handleButtonDown(event);
|
||||||
@ -614,8 +619,12 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
|||||||
}
|
}
|
||||||
|
|
||||||
boolean handled = false;
|
boolean handled = false;
|
||||||
if (event.getDevice() == null ||
|
boolean detectedGamepad = event.getDevice() == null ? false :
|
||||||
event.getDevice().getKeyboardType() != InputDevice.KEYBOARD_TYPE_ALPHABETIC) {
|
((event.getDevice().getSources() & InputDevice.SOURCE_JOYSTICK) != 0 ||
|
||||||
|
(event.getDevice().getSources() & InputDevice.SOURCE_GAMEPAD) != 0);
|
||||||
|
if (detectedGamepad || (event.getDevice() == null ||
|
||||||
|
event.getDevice().getKeyboardType() != InputDevice.KEYBOARD_TYPE_ALPHABETIC
|
||||||
|
)) {
|
||||||
// Always try the controller handler first, unless it's an alphanumeric keyboard device.
|
// Always try the controller handler first, unless it's an alphanumeric keyboard device.
|
||||||
// Otherwise, controller handler will eat keyboard d-pad events.
|
// Otherwise, controller handler will eat keyboard d-pad events.
|
||||||
handled = controllerHandler.handleButtonUp(event);
|
handled = controllerHandler.handleButtonUp(event);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user