From fca65dd2f98b3ea5bbd8df1bb809181b2287ba7f Mon Sep 17 00:00:00 2001 From: Flyinghead Date: Thu, 14 Feb 2019 00:55:02 +0100 Subject: [PATCH] android: virtual gamepad asn't responsive --- .../src/main/java/com/reicast/emulator/emu/GL2JNIView.java | 4 +++- .../android-studio/reicast/src/main/jni/src/android_gamepad.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/shell/android-studio/reicast/src/main/java/com/reicast/emulator/emu/GL2JNIView.java b/shell/android-studio/reicast/src/main/java/com/reicast/emulator/emu/GL2JNIView.java index bcc886fb5..f4351370b 100644 --- a/shell/android-studio/reicast/src/main/java/com/reicast/emulator/emu/GL2JNIView.java +++ b/shell/android-studio/reicast/src/main/java/com/reicast/emulator/emu/GL2JNIView.java @@ -499,7 +499,9 @@ public class GL2JNIView extends GLSurfaceView int joyx = get_anal(11, 0); int joyy = get_anal(11, 1); InputDeviceManager.getInstance().virtualGamepadEvent(rv, joyx, joyy, left_trigger, right_trigger); - InputDeviceManager.getInstance().mouseEvent(mouse_pos[0], mouse_pos[1], mouse_btns); + // Only register the mouse event if no virtual gamepad button is down + if (rv == 0xFFFF) + InputDeviceManager.getInstance().mouseEvent(mouse_pos[0], mouse_pos[1], mouse_btns); return(true); } diff --git a/shell/android-studio/reicast/src/main/jni/src/android_gamepad.h b/shell/android-studio/reicast/src/main/jni/src/android_gamepad.h index a5b90641d..ed44ca44d 100644 --- a/shell/android-studio/reicast/src/main/jni/src/android_gamepad.h +++ b/shell/android-studio/reicast/src/main/jni/src/android_gamepad.h @@ -131,7 +131,7 @@ public: previous_kcode = kcode; } - static const int VIRTUAL_GAMEPAD_ID = 123456; + static const int VIRTUAL_GAMEPAD_ID = 0x12345678; // must match the Java definition protected: virtual void load_axis_min_max(u32 axis) override