From eb89bbd909832081e7896f53d94113e54166b658 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Tue, 13 Oct 2020 23:11:52 +1000 Subject: [PATCH] Android: Fix right stick/L2/R2 on external controller --- .../stenzek/duckstation/EmulationSurfaceView.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/android/app/src/main/java/com/github/stenzek/duckstation/EmulationSurfaceView.java b/android/app/src/main/java/com/github/stenzek/duckstation/EmulationSurfaceView.java index cf90f881e..7a3c55aac 100644 --- a/android/app/src/main/java/com/github/stenzek/duckstation/EmulationSurfaceView.java +++ b/android/app/src/main/java/com/github/stenzek/duckstation/EmulationSurfaceView.java @@ -90,8 +90,8 @@ public class EmulationSurfaceView extends SurfaceView { private ArrayMap mControllerKeyMapping; private ArrayMap mControllerAxisMapping; private ArrayMap> mControllerAxisButtonMapping; - static final int[] AXISES = new int[]{MotionEvent.AXIS_X, MotionEvent.AXIS_Y, MotionEvent.AXIS_RX, - MotionEvent.AXIS_RY, MotionEvent.AXIS_Z, MotionEvent.AXIS_RZ, + static final int[] AXISES = new int[]{MotionEvent.AXIS_X, MotionEvent.AXIS_Y, MotionEvent.AXIS_Z, + MotionEvent.AXIS_RZ, MotionEvent.AXIS_LTRIGGER, MotionEvent.AXIS_RTRIGGER, MotionEvent.AXIS_HAT_X, MotionEvent.AXIS_HAT_Y}; private void addControllerKeyMapping(int keyCode, String controllerType, String buttonName) { @@ -145,10 +145,10 @@ public class EmulationSurfaceView extends SurfaceView { addControllerKeyMapping(KeyEvent.KEYCODE_BUTTON_R2, controllerType, "R2"); addControllerAxisMapping(MotionEvent.AXIS_X, controllerType, "LeftX", null, null); addControllerAxisMapping(MotionEvent.AXIS_Y, controllerType, "LeftY", null, null); - addControllerAxisMapping(MotionEvent.AXIS_RX, controllerType, "RightX", null, null); - addControllerAxisMapping(MotionEvent.AXIS_RY, controllerType, "RightY", null, null); - addControllerAxisMapping(MotionEvent.AXIS_Z, controllerType, "L2", "L2", "L2"); - addControllerAxisMapping(MotionEvent.AXIS_RZ, controllerType, "R2", "R2", "R2"); + addControllerAxisMapping(MotionEvent.AXIS_Z, controllerType, "RightX", null, null); + addControllerAxisMapping(MotionEvent.AXIS_RZ, controllerType, "RightY", null, null); + addControllerAxisMapping(MotionEvent.AXIS_LTRIGGER, controllerType, "L2", "L2", "L2"); + addControllerAxisMapping(MotionEvent.AXIS_RTRIGGER, controllerType, "R2", "R2", "R2"); addControllerAxisMapping(MotionEvent.AXIS_HAT_X, controllerType, null, "Left", "Right"); addControllerAxisMapping(MotionEvent.AXIS_HAT_Y, controllerType, null, "Up", "Down"); }