mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2026-04-04 06:56:06 +00:00
Merge remote-tracking branch 'origin/master' into new-core
This commit is contained in:
@@ -561,8 +561,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);
|
||||
@@ -599,8 +604,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);
|
||||
|
||||
Reference in New Issue
Block a user