Commit f457f25b authored by David Lawrie's avatar David Lawrie Committed by Alexandre Julliard

winejoystick.drv: Fix Slider mapping.

Sliders, Dials, and Wheels now map to Z, U (Ry), or V (Rx) depending on availability. Thus, also add support for up to 3 such HID elements. Signed-off-by: 's avatarDavid Lawrie <david.dljunk@gmail.com> Signed-off-by: 's avatarKen Thomases <ken@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 5ea6200f
......@@ -442,8 +442,25 @@ static void collect_joystick_elements(joystick_t* joystick, IOHIDElementRef coll
break;
}
case kHIDUsage_GD_Slider:
TRACE("kIOHIDElementTypeInput_Misc / kHIDUsage_GD_Slider; ignoring\n");
case kHIDUsage_GD_Dial:
case kHIDUsage_GD_Wheel:
{
/* if one axis is taken, fall to the next until axes are filled */
int possible_axes[3] = {AXIS_Z,AXIS_RY,AXIS_RX};
int axis = 0;
while(axis < 3 && joystick->axes[possible_axes[axis]].element)
axis++;
if (axis == 3)
TRACE("kIOHIDElementTypeInput_Misc / kHIDUsage_GD_<axis> (%d)\n ignoring\n", usage);
else
{
TRACE("kIOHIDElementTypeInput_Misc / kHIDUsage_GD_<axis> (%d) axis %d\n", usage, possible_axes[axis]);
joystick->axes[possible_axes[axis]].element = (IOHIDElementRef)CFRetain(child);
joystick->axes[possible_axes[axis]].min_value = IOHIDElementGetLogicalMin(child);
joystick->axes[possible_axes[axis]].max_value = IOHIDElementGetLogicalMax(child);
}
break;
}
default:
FIXME("kIOHIDElementTypeInput_Misc / Unhandled usage %d\n", usage);
break;
......
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