(Apple) hid_device_input_callback - cleanup
This commit is contained in:
parent
4a4888dda9
commit
03378289d7
|
@ -79,12 +79,13 @@ static void hid_device_input_callback(void* context, IOReturn result,
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < 4; i ++)
|
for (i = 0; i < 4; i ++)
|
||||||
{
|
|
||||||
if (use == axis_use_ids[i])
|
|
||||||
{
|
{
|
||||||
CFIndex min, max, state;
|
CFIndex min, max, state;
|
||||||
float val;
|
float val;
|
||||||
|
|
||||||
|
if (use != axis_use_ids[i])
|
||||||
|
continue;
|
||||||
|
|
||||||
min = IOHIDElementGetPhysicalMin(element);
|
min = IOHIDElementGetPhysicalMin(element);
|
||||||
max = IOHIDElementGetPhysicalMax(element) - min;
|
max = IOHIDElementGetPhysicalMax(element) - min;
|
||||||
state = IOHIDValueGetIntegerValue(value) - min;
|
state = IOHIDValueGetIntegerValue(value) - min;
|
||||||
|
@ -94,7 +95,6 @@ static void hid_device_input_callback(void* context, IOReturn result,
|
||||||
((val * 2.0f) - 1.0f) * 32767.0f;
|
((val * 2.0f) - 1.0f) * 32767.0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue