mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-19 02:53:05 +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;
|
||||
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.
|
||||
// Otherwise, controller handler will eat keyboard d-pad events.
|
||||
handled = controllerHandler.handleButtonDown(event);
|
||||
@ -614,8 +619,12 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
||||
}
|
||||
|
||||
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.
|
||||
// Otherwise, controller handler will eat keyboard d-pad events.
|
||||
handled = controllerHandler.handleButtonUp(event);
|
||||
|
Loading…
x
Reference in New Issue
Block a user