Commit 5d51d8a2 authored by Tim Schumacher's avatar Tim Schumacher Committed by Alexandre Julliard

dinput/linuxinput: Remap wheel axes to X, Y, and Z.

parent eb69fa7e
...@@ -502,14 +502,18 @@ static JoystickImpl *alloc_device(REFGUID rguid, IDirectInputImpl *dinput, unsig ...@@ -502,14 +502,18 @@ static JoystickImpl *alloc_device(REFGUID rguid, IDirectInputImpl *dinput, unsig
/* Count number of available axes - supported Axis & POVs */ /* Count number of available axes - supported Axis & POVs */
for (i = 0; i < ABS_MAX; i++) for (i = 0; i < ABS_MAX; i++)
{ {
if (i < WINE_JOYSTICK_MAX_AXES && if (idx < WINE_JOYSTICK_MAX_AXES &&
i < ABS_HAT0X &&
test_bit(newDevice->joydev->absbits, i)) test_bit(newDevice->joydev->absbits, i))
{ {
newDevice->generic.device_axis_count++; newDevice->generic.device_axis_count++;
newDevice->dev_axes_to_di[i] = idx; newDevice->dev_axes_to_di[i] = idx;
newDevice->generic.props[idx].lDevMin = newDevice->joydev->axes[i].minimum; newDevice->generic.props[idx].lDevMin = newDevice->joydev->axes[i].minimum;
newDevice->generic.props[idx].lDevMax = newDevice->joydev->axes[i].maximum; newDevice->generic.props[idx].lDevMax = newDevice->joydev->axes[i].maximum;
default_axis_map[idx] = i; if (i >= 8 && i <= 10) /* If it's a wheel axis... */
default_axis_map[idx] = i - 8; /* ... remap to X/Y/Z */
else
default_axis_map[idx] = i;
idx++; idx++;
} }
else else
......
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