mirror of
https://github.com/X11Libre/xf86-input-evdev.git
synced 2026-04-14 11:44:16 +00:00
Only map x and y to axes 0 and 1
The Logitech G600 has one device with all axes north of ABS_MISC. The current code assigns ABS_MISC as first axis to map to axis 0, i.e. x. On button press, one node sends the BTN_LEFT but the other node sends an ABS_MISC with a 1 0 value. ABS_MISC is mapped to axis 0, this moves the pointer to (0, y) on every button click. Avoid this by simply mapping any axis other than x/y to at least axis 3, and make sure we only override the MT 0/1 axes when we actually have MT axes. https://bugs.freedesktop.org/show_bug.cgi?id=92856 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
11
src/evdev.c
11
src/evdev.c
@@ -1377,7 +1377,7 @@ EvdevAddAbsValuatorClass(DeviceIntPtr device, int num_scroll_axes)
|
||||
}
|
||||
atoms = malloc((pEvdev->num_vals + num_mt_axes) * sizeof(Atom));
|
||||
|
||||
i = 0;
|
||||
i = 2;
|
||||
for (axis = ABS_X; i < MAX_VALUATORS && axis <= ABS_MAX; axis++) {
|
||||
int j;
|
||||
pEvdev->abs_axis_map[axis] = -1;
|
||||
@@ -1385,9 +1385,14 @@ EvdevAddAbsValuatorClass(DeviceIntPtr device, int num_scroll_axes)
|
||||
is_blacklisted_axis(axis))
|
||||
continue;
|
||||
|
||||
mapping = i;
|
||||
if (axis == ABS_X)
|
||||
mapping = 0;
|
||||
else if (axis == ABS_Y)
|
||||
mapping = 1;
|
||||
else
|
||||
mapping = i;
|
||||
|
||||
for (j = 0; j < ArrayLength(mt_axis_mappings); j++)
|
||||
for (j = 0; !pEvdev->fake_mt && j < ArrayLength(mt_axis_mappings); j++)
|
||||
{
|
||||
if (mt_axis_mappings[j].code == axis)
|
||||
mt_axis_mappings[j].mapping = mapping;
|
||||
|
||||
Reference in New Issue
Block a user