diff options
| author | Ryan Houdek <Sonicadvance1@gmail.com> | 2013-11-24 15:04:53 -0600 |
|---|---|---|
| committer | Ryan Houdek <Sonicadvance1@gmail.com> | 2013-11-24 15:04:53 -0600 |
| commit | f6f2b1fc60067b19068f2d0edbbfbfe5e73a0806 (patch) | |
| tree | f2ac5a15688b1811c3b6733b99d069657c7dd87a /Source/Android | |
| parent | 42f8562e5c7acfb6b697672f419f0f28366a5261 (diff) | |
[Android-overlay] Support multiple gamepads with touch screen controls.
Diffstat (limited to 'Source/Android')
3 files changed, 85 insertions, 8 deletions
diff --git a/Source/Android/assets/GCPadNew.ini b/Source/Android/assets/GCPadNew.ini index 7e770f60d3..77e790d0fa 100644 --- a/Source/Android/assets/GCPadNew.ini +++ b/Source/Android/assets/GCPadNew.ini @@ -25,5 +25,80 @@ D-Pad/Down = `Button 7` D-Pad/Left = `Button 8` D-Pad/Right = `Button 9` [GCPad2] +Device = Android/1/Touchscreen +Buttons/A = `Button 0` +Buttons/B = `Button 1` +Buttons/X = `Button 3` +Buttons/Y = `Button 4` +Buttons/Z = `Button 5` +Buttons/Start = `Button 2` +Main Stick/Up = `Axis 11` +Main Stick/Down = `Axis 12` +Main Stick/Left = `Axis 13` +Main Stick/Right = `Axis 14` +Main Stick/Modifier = Shift_L +Main Stick/Modifier/Range = 50.000000 +C-Stick/Up = `Axis 15` +C-Stick/Down = `Axis 16` +C-Stick/Left = `Axis 17` +C-Stick/Right = `Axis 18` +C-Stick/Modifier = Control_L +C-Stick/Modifier/Range = 50.000000 +Triggers/L = `Axis 18` +Triggers/R = `Axis 19` +D-Pad/Up = `Button 6` +D-Pad/Down = `Button 7` +D-Pad/Left = `Button 8` +D-Pad/Right = `Button 9` [GCPad3] +Device = Android/2/Touchscreen +Buttons/A = `Button 0` +Buttons/B = `Button 1` +Buttons/X = `Button 3` +Buttons/Y = `Button 4` +Buttons/Z = `Button 5` +Buttons/Start = `Button 2` +Main Stick/Up = `Axis 11` +Main Stick/Down = `Axis 12` +Main Stick/Left = `Axis 13` +Main Stick/Right = `Axis 14` +Main Stick/Modifier = Shift_L +Main Stick/Modifier/Range = 50.000000 +C-Stick/Up = `Axis 15` +C-Stick/Down = `Axis 16` +C-Stick/Left = `Axis 17` +C-Stick/Right = `Axis 18` +C-Stick/Modifier = Control_L +C-Stick/Modifier/Range = 50.000000 +Triggers/L = `Axis 18` +Triggers/R = `Axis 19` +D-Pad/Up = `Button 6` +D-Pad/Down = `Button 7` +D-Pad/Left = `Button 8` +D-Pad/Right = `Button 9` [GCPad4] +Device = Android/3/Touchscreen +Buttons/A = `Button 0` +Buttons/B = `Button 1` +Buttons/X = `Button 3` +Buttons/Y = `Button 4` +Buttons/Z = `Button 5` +Buttons/Start = `Button 2` +Main Stick/Up = `Axis 11` +Main Stick/Down = `Axis 12` +Main Stick/Left = `Axis 13` +Main Stick/Right = `Axis 14` +Main Stick/Modifier = Shift_L +Main Stick/Modifier/Range = 50.000000 +C-Stick/Up = `Axis 15` +C-Stick/Down = `Axis 16` +C-Stick/Left = `Axis 17` +C-Stick/Right = `Axis 18` +C-Stick/Modifier = Control_L +C-Stick/Modifier/Range = 50.000000 +Triggers/L = `Axis 18` +Triggers/R = `Axis 19` +D-Pad/Up = `Button 6` +D-Pad/Down = `Button 7` +D-Pad/Left = `Button 8` +D-Pad/Right = `Button 9` diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/NativeLibrary.java b/Source/Android/src/org/dolphinemu/dolphinemu/NativeLibrary.java index 7745deadba..ac6275301d 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/NativeLibrary.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/NativeLibrary.java @@ -56,19 +56,21 @@ public final class NativeLibrary /** * Handles touch events. * - * @param Button Key code identifying which button was pressed. + * @param padID Identifier for which GCpad 0-3, + * @param Button Key code identifying which button was pressed, * @param Action Mask for the action being performed. */ - public static native void onTouchEvent(int Button, int Action); + public static native void onTouchEvent(int padID, int Button, int Action); /** * Handles axis-related touch events. * - * @param Axis Axis ID for the type of axis being altered. (Example: Main stick up, down, left, right, etc). + * @param padID Identifier for which GCpad 0-3, + * @param Axis Axis ID for the type of axis being altered. (Example: Main stick up, down, left, right, etc), * @param force How 'far down' the joystick is pushed down. 0.0f indicates center (or no force), * 1.0f indicates max force (or joystick pushed all the way down in any arbitrary direction). */ - public static native void onTouchAxisEvent(int Axis, float force); + public static native void onTouchAxisEvent(int padID, int Axis, float force); /** * Handles button press events for a gamepad. diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/emulation/overlay/InputOverlay.java b/Source/Android/src/org/dolphinemu/dolphinemu/emulation/overlay/InputOverlay.java index 26f628ed46..4f34df7dc6 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/emulation/overlay/InputOverlay.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/emulation/overlay/InputOverlay.java @@ -96,15 +96,15 @@ public final class InputOverlay extends SurfaceView implements OnTouchListener switch (button.getId()) { case ButtonType.BUTTON_A: - NativeLibrary.onTouchEvent(ButtonType.BUTTON_A, buttonState); + NativeLibrary.onTouchEvent(0, ButtonType.BUTTON_A, buttonState); break; case ButtonType.BUTTON_B: - NativeLibrary.onTouchEvent(ButtonType.BUTTON_B, buttonState); + NativeLibrary.onTouchEvent(0, ButtonType.BUTTON_B, buttonState); break; case ButtonType.BUTTON_START: - NativeLibrary.onTouchEvent(ButtonType.BUTTON_START, buttonState); + NativeLibrary.onTouchEvent(0, ButtonType.BUTTON_START, buttonState); break; default: @@ -121,7 +121,7 @@ public final class InputOverlay extends SurfaceView implements OnTouchListener for (int a = 0; a < 4; ++a) { - NativeLibrary.onTouchAxisEvent(axisIDs[a], axises[a]); + NativeLibrary.onTouchAxisEvent(0, axisIDs[a], axises[a]); } } |
