Commit 905e7b0e authored by Tim Schumacher's avatar Tim Schumacher Committed by Alexandre Julliard

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: 's avatarTim Schumacher <timschumi@gmx.de> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 1058647e
...@@ -270,10 +270,13 @@ LRESULT driver_joyGetDevCaps(DWORD_PTR dwDevID, LPJOYCAPSW lpCaps, DWORD dwSize) ...@@ -270,10 +270,13 @@ LRESULT driver_joyGetDevCaps(DWORD_PTR dwDevID, LPJOYCAPSW lpCaps, DWORD dwSize)
switch (jstck->axesMap[i]) { switch (jstck->axesMap[i]) {
case 0: /* X */ case 0: /* X */
case 1: /* Y */ case 1: /* Y */
case 8: /* Wheel */
case 9: /* Gas */
lpCaps->wNumAxes++; lpCaps->wNumAxes++;
break; break;
case 2: /* Z */ case 2: /* Z */
case 6: /* Throttle */ case 6: /* Throttle */
case 10: /* Brake */
lpCaps->wNumAxes++; lpCaps->wNumAxes++;
lpCaps->wCaps |= JOYCAPS_HASZ; lpCaps->wCaps |= JOYCAPS_HASZ;
break; break;
...@@ -322,13 +325,16 @@ LRESULT driver_joyGetPosEx(DWORD_PTR dwDevID, LPJOYINFOEX lpInfo) ...@@ -322,13 +325,16 @@ LRESULT driver_joyGetPosEx(DWORD_PTR dwDevID, LPJOYINFOEX lpInfo)
if (ev.type == (JS_EVENT_AXIS)) { if (ev.type == (JS_EVENT_AXIS)) {
switch (jstck->axesMap[ev.number]) { switch (jstck->axesMap[ev.number]) {
case 0: /* X */ case 0: /* X */
case 8: /* Wheel */
jstck->x = ev.value; jstck->x = ev.value;
break; break;
case 1: /* Y */ case 1: /* Y */
case 9: /* Gas */
jstck->y = ev.value; jstck->y = ev.value;
break; break;
case 2: /* Z */ case 2: /* Z */
case 6: /* Throttle */ case 6: /* Throttle */
case 10: /* Brake */
jstck->z = ev.value; jstck->z = ev.value;
break; break;
case 5: /* Rz */ case 5: /* Rz */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment