[input] Get single axis info for unbound devices

This doesn't fix the problem of keyhelp not working for axes belonging
to unbound devices, but may be a step in the right direction.
This commit is contained in:
Bill Currie 2021-12-23 13:55:52 +09:00
parent 2e3e9ea7c0
commit 7571231100

View file

@ -298,13 +298,9 @@ in_keyhelp_event_handler (const IE_event_t *ie_event, void *unused)
if (db) {
ai = &db->axis_info[axis];
} else {
//FIXME set single axis info entry
int num_axes;
in_axisinfo_t *axis_info;
IN_AxisInfo (devid, 0, &num_axes);
axis_info = alloca (num_axes * sizeof (in_axisinfo_t));
IN_AxisInfo (devid, axis_info, &num_axes);
ai = &axis_info[axis];
in_axisinfo_t axis_info;
IN_GetAxisInfo (devid, axis, &axis_info);
ai = &axis_info;
}
if (!ai->min && !ai->max) {
if (abs (value) > keyhelp_axis_threshold) {