Bug 104630 - evdev driver incorrectly handles devices with only buttons
Summary: evdev driver incorrectly handles devices with only buttons
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Input/evdev (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Peter Hutterer
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-14 22:45 UTC by Andrey Zabolotnyi
Modified: 2018-01-16 06:33 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
proposed fix (1.16 KB, patch)
2018-01-14 22:45 UTC, Andrey Zabolotnyi
no flags Details | Splinter Review

Description Andrey Zabolotnyi 2018-01-14 22:45:17 UTC
Created attachment 136719 [details] [review]
proposed fix

When a input device with only buttons is present (e.g. BTN_0..BTN_9), in Xorg.log I can see the following:

evdev: Huion HA60-F400 Tablet Pad: Device: "/dev/input/event3"
evdev: Huion HA60-F400 Tablet Pad: Vendor 0x256c Product 0x6e
evdev: Huion HA60-F400 Tablet Pad: Found 16 mouse buttons
evdev: Huion HA60-F400 Tablet Pad: Forcing relative x/y axes to exist.
evdev: Huion HA60-F400 Tablet Pad: Configuring as mouse
evdev: Huion HA60-F400 Tablet Pad: YAxisMapping: buttons 4 and 5
evdev: Huion HA60-F400 Tablet Pad: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200

However, "xinput list" will show the device listed as a slave of "Virtual core keyboard". As a consequence, GIMP fails to show this device in the "extended input device" dialog (don't ask me why) and Plasma5 crashes when you do "xinput test <device>" (also don't ask me why). Anyways, if it is "Configuring as mouse", I would expect it to be a slave of "Virtual core pointer".

A inspection of the evdev driver revealed a small mistake: the relative X and Y axes are added to the device, but EVDEV_RELATIVE_EVENTS flag is not set. This leads to the above described effects.

The small attached patch fixes this.
Comment 1 Peter Hutterer 2018-01-16 06:33:33 UTC
Pushed as 192fdb06905f0f190e3a0e258919676934e6633c, thanks!


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.