diff options
| author | Ruslan Mustakov | 2018-04-16 11:19:07 +0700 |
|---|---|---|
| committer | Ruslan Mustakov | 2018-04-16 11:19:07 +0700 |
| commit | 5dffa506dc3168e96b4a03d1defbf34661cdff05 (patch) | |
| tree | 180168c9af8c1fe653d3fdf9788b758b2b669c8a /platform/android/java | |
| parent | 7b5703bc41460c5c8b955f879190625da85a2a81 (diff) | |
| download | godot-5dffa506dc3168e96b4a03d1defbf34661cdff05.tar.gz godot-5dffa506dc3168e96b4a03d1defbf34661cdff05.tar.zst godot-5dffa506dc3168e96b4a03d1defbf34661cdff05.zip | |
Diffstat (limited to 'platform/android/java')
| -rw-r--r-- | platform/android/java/src/org/godotengine/godot/GodotView.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/platform/android/java/src/org/godotengine/godot/GodotView.java b/platform/android/java/src/org/godotengine/godot/GodotView.java index 0222758c2..23723c269 100644 --- a/platform/android/java/src/org/godotengine/godot/GodotView.java +++ b/platform/android/java/src/org/godotengine/godot/GodotView.java @@ -261,7 +261,7 @@ public class GodotView extends GLSurfaceView implements InputDeviceListener { }; int source = event.getSource(); - if ((source & InputDevice.SOURCE_JOYSTICK) != 0 || (source & InputDevice.SOURCE_DPAD) != 0 || (source & InputDevice.SOURCE_GAMEPAD) != 0) { + if ((source & InputDevice.SOURCE_JOYSTICK) == InputDevice.SOURCE_JOYSTICK || (source & InputDevice.SOURCE_DPAD) == InputDevice.SOURCE_DPAD || (source & InputDevice.SOURCE_GAMEPAD) == InputDevice.SOURCE_GAMEPAD) { final int button = get_godot_button(keyCode); final int device = find_joy_device(event.getDeviceId()); @@ -302,7 +302,7 @@ public class GodotView extends GLSurfaceView implements InputDeviceListener { int source = event.getSource(); //Log.e(TAG, String.format("Key down! source %d, device %d, joystick %d, %d, %d", event.getDeviceId(), source, (source & InputDevice.SOURCE_JOYSTICK), (source & InputDevice.SOURCE_DPAD), (source & InputDevice.SOURCE_GAMEPAD))); - if ((source & InputDevice.SOURCE_JOYSTICK) != 0 || (source & InputDevice.SOURCE_DPAD) != 0 || (source & InputDevice.SOURCE_GAMEPAD) != 0) { + if ((source & InputDevice.SOURCE_JOYSTICK) == InputDevice.SOURCE_JOYSTICK || (source & InputDevice.SOURCE_DPAD) == InputDevice.SOURCE_DPAD || (source & InputDevice.SOURCE_GAMEPAD) == InputDevice.SOURCE_GAMEPAD) { if (event.getRepeatCount() > 0) // ignore key echo return true; |
