diff --git a/Assets/defctrl.json b/Assets/defctrl.json index 35d4b3a326..92467a990d 100644 --- a/Assets/defctrl.json +++ b/Assets/defctrl.json @@ -129,7 +129,7 @@ "ZR": "R, J1 B8, X1 RightTrigger", "Select": "Space, J1 B9, X1 Back", "Start": "Enter, J1 B10, X1 Start", - "Touch": "WMouse L", + "Touch": "WMouse L, X1 Touchpad", "Tilt": "WMouse R", }, "NDS Controller": { @@ -145,7 +145,7 @@ "R": "E, J1 B6, X1 RightShoulder", "Select": "Space, J1 B9, X1 Back", "Start": "Enter, J1 B10, X1 Start", - "Touch": "WMouse L", + "Touch": "WMouse L, X1 Touchpad", "Microphone": "M" }, "Atari 2600 Basic Controller": { diff --git a/src/BizHawk.Bizware.Input/SDL2/SDL2Gamepad.cs b/src/BizHawk.Bizware.Input/SDL2/SDL2Gamepad.cs index 34b92b0bdc..6fceb3b8ac 100644 --- a/src/BizHawk.Bizware.Input/SDL2/SDL2Gamepad.cs +++ b/src/BizHawk.Bizware.Input/SDL2/SDL2Gamepad.cs @@ -294,7 +294,9 @@ private SDL2Gamepad(int index) ("RightTrigger", Conv(SDL_GameControllerGetAxis(Opaque, SDL_GameControllerAxis.SDL_CONTROLLER_AXIS_TRIGGERRIGHT))) ]; - static int TouchConv(float num) => (int)((num * 2.0f - 1.0f) * 10000.0f); + // note: this mimics the mouse conversion in MainForm + // also, don't try to "correct" the Y axis here, -/+ for u/d is how mouse does it, so that should be used here + static int TouchConv(float num) => (int)((num * 20000) - 10000); var numTouchpads = SDL_GameControllerGetNumTouchpads(Opaque); if (numTouchpads == 1) { @@ -305,7 +307,7 @@ private SDL2Gamepad(int index) if (state != 0) { values.Add(("TouchpadX", TouchConv(x))); - values.Add(("TouchpadY", -TouchConv(y))); + values.Add(("TouchpadY", TouchConv(y))); } else { @@ -321,7 +323,7 @@ private SDL2Gamepad(int index) if (state != 0) { values.Add(($"Touchpad{i}X", TouchConv(x))); - values.Add(($"Touchpad{i}Y", -TouchConv(y))); + values.Add(($"Touchpad{i}Y", TouchConv(y))); } else {