Module: wine
Branch: stable
Commit: 313dc20036b7a957af278ccc0ddbcd0a2a8d2680
URL: https://source.winehq.org/git/wine.git/?a=commit;h=313dc20036b7a957af278ccc…
Author: Tim Schumacher <timschumi(a)gmx.de>
Date: Sun Mar 31 13:09:43 2019 +0200
dinput: Map wheel, gas, and brake axes as well.
The axes wheel, gas, and brake are just differently named replacements
for X, Y, and Z when using wheel-like joysticks.
Make those accessible by remapping them to X, Y, and Z internally.
Signed-off-by: Tim Schumacher <timschumi(a)gmx.de>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
(cherry picked from commit 1a6458bad8191a8188d76ba21b38ef457bfe1295)
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/dinput/joystick_linux.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/dlls/dinput/joystick_linux.c b/dlls/dinput/joystick_linux.c
index 963e62f..c4efc93 100644
--- a/dlls/dinput/joystick_linux.c
+++ b/dlls/dinput/joystick_linux.c
@@ -239,6 +239,14 @@ static INT find_joystick_devices(void)
joydev.dev_axes_map[j] = j;
found_axes++;
}
+ else if (axes_map[j] <= 10)
+ {
+ /* Axes 8 through 10 are Wheel, Gas and Brake,
+ * remap to 0, 1 and 2
+ */
+ joydev.dev_axes_map[j] = axes_map[j] - 8;
+ found_axes++;
+ }
else if (axes_map[j] == 16 ||
axes_map[j] == 17)
{
Module: wine
Branch: stable
Commit: 4fcf59e0f2c2a5b4a10d60f45557c02ee4de8e03
URL: https://source.winehq.org/git/wine.git/?a=commit;h=4fcf59e0f2c2a5b4a10d60f4…
Author: Tim Schumacher <timschumi(a)gmx.de>
Date: Sun Mar 31 13:02:27 2019 +0200
winejoystick: Add support for wheel axes.
Wheel, gas, and brake are replacements for X, Y and Z in wheel-like
joysticks. Remap them internally to send inputs as X, Y, and Z.
Signed-off-by: Tim Schumacher <timschumi(a)gmx.de>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
(cherry picked from commit 905e7b0e2ef99c7ccfa5a3dda0844d5ea40afc77)
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/winejoystick.drv/joystick_linux.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/dlls/winejoystick.drv/joystick_linux.c b/dlls/winejoystick.drv/joystick_linux.c
index 287f4be..7c24040 100644
--- a/dlls/winejoystick.drv/joystick_linux.c
+++ b/dlls/winejoystick.drv/joystick_linux.c
@@ -280,10 +280,13 @@ static const WCHAR ini[] = {'W','i','n','e',' ','J','o','y','s','t','i','c','k',
switch (jstck->axesMap[i]) {
case 0: /* X */
case 1: /* Y */
+ case 8: /* Wheel */
+ case 9: /* Gas */
lpCaps->wNumAxes++;
break;
case 2: /* Z */
case 6: /* Throttle */
+ case 10: /* Brake */
lpCaps->wNumAxes++;
lpCaps->wCaps |= JOYCAPS_HASZ;
break;
@@ -365,13 +368,16 @@ LRESULT driver_joyGetPosEx(DWORD_PTR dwDevID, LPJOYINFOEX lpInfo)
if (ev.type == (JS_EVENT_AXIS)) {
switch (jstck->axesMap[ev.number]) {
case 0: /* X */
+ case 8: /* Wheel */
jstck->x = ev.value;
break;
case 1: /* Y */
+ case 9: /* Gas */
jstck->y = ev.value;
break;
case 2: /* Z */
case 6: /* Throttle */
+ case 10: /* Brake */
jstck->z = ev.value;
break;
case 5: /* Rz */