dinput: Assume a 1-to-1 axes map when no axes match.
The wiimote is a well known problematic device, mainly because it is not a joystick. It is a USB device. But the classic controller is at least advertised as a joystick with 6 axes and 11 buttons (js driver only, NO event). Signed-off-by: Bruno Jesus <bjesus@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
985acda3ee
commit
e87ccb8b05
|
@ -228,19 +228,36 @@ static INT find_joystick_devices(void)
|
|||
else
|
||||
if ((joydev.dev_axes_map = HeapAlloc(GetProcessHeap(), 0, joydev.axis_count * sizeof(int))))
|
||||
{
|
||||
INT j;
|
||||
INT j, found_axes = 0;
|
||||
|
||||
/* Remap to DI numbers */
|
||||
for (j = 0; j < joydev.axis_count; j++)
|
||||
{
|
||||
if (axes_map[j] < 8)
|
||||
{
|
||||
/* Axis match 1-to-1 */
|
||||
joydev.dev_axes_map[j] = j;
|
||||
found_axes++;
|
||||
}
|
||||
else if (axes_map[j] == 16 ||
|
||||
axes_map[j] == 17)
|
||||
{
|
||||
/* POV axis */
|
||||
joydev.dev_axes_map[j] = 8;
|
||||
found_axes++;
|
||||
}
|
||||
else
|
||||
joydev.dev_axes_map[j] = -1;
|
||||
}
|
||||
|
||||
/* If no axes were configured but there are axes assume a 1-to-1 (wii controller) */
|
||||
if (joydev.axis_count && !found_axes)
|
||||
{
|
||||
ERR("Incoherent joystick data, advertised %d axes, detected 0. Assuming 1-to-1.\n",
|
||||
joydev.axis_count);
|
||||
for (j = 0; j < joydev.axis_count; j++)
|
||||
joydev.dev_axes_map[j] = j;
|
||||
}
|
||||
}
|
||||
|
||||
/* Find vendor_id and product_id in sysfs */
|
||||
|
|
Loading…
Reference in New Issue