Bug 93474 - libinput doesn't work with keyboard function exposed by anker 8200 laser mouse
Summary: libinput doesn't work with keyboard function exposed by anker 8200 laser mouse
Status: RESOLVED FIXED
Alias: None
Product: Wayland
Classification: Unclassified
Component: libinput (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Peter Hutterer
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-22 11:02 UTC by Weng Xuetian
Modified: 2016-01-11 23:31 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
evemu-describe (9.24 KB, text/plain)
2015-12-23 04:23 UTC, Weng Xuetian
Details
https://bugs.freedesktop.org/show_bug.cgi?id=93474 (11.11 KB, patch)
2015-12-23 06:04 UTC, Peter Hutterer
Details | Splinter Review

Description Weng Xuetian 2015-12-22 11:02:22 UTC
Mouse product link: http://www.anker.com/product/98ANDS2368-BA
lsusb output: Bus 001 Device 004: ID 04d9:fa50 Holtek Semiconductor, Inc. 

This mouse is programmable and can bind some mouse button as a keyboard key. It used to work without problem with xf86-input-evdev, but keyboard simulation fails to work with xf86-input-libinput, only pointer and mouse button works.

Also tried it with wayland, it still fails to work under wayland.

After inspect xorg.0.log, there's some error log with "Failed to create a device for /dev/input/event...". libinput-debug-events --device also failes to initialize the device.

When using xf86-input-evdev, xinput list shows it as:
⎡ Virtual core pointer                          id=2    [master pointer  (3)]
⎜   ↳ USB Laser Game Mouse                      id=9    [slave  pointer  (2)]
⎜   ↳ USB Laser Game Mouse                      id=11   [slave  pointer  (2)]
⎣ Virtual core keyboard                         id=3    [master keyboard (2)]
    ↳ USB Laser Game Mouse                      id=10   [slave  keyboard (3)]

The problematic device for libinput is the one with id 11. Id 11 device is captured by 'MatchIsKeyboard "true"' rule, but considered as pointer by xf86-input-evdev. But it actually sends key event as shown by "xinput test-xi2 11". "xinput test-xi2" 10 shows that id=10 device doesn't do anything. Maybe that's why it fails to work with libinput.
Comment 1 Peter Hutterer 2015-12-23 03:59:57 UTC
Please attach an evemu-describe output from this device and try xf86-input-libinput 0.16 (released only one minute ago). That version should have the fixes to address the issues you're seeing.
Comment 2 Weng Xuetian 2015-12-23 04:23:53 UTC
Created attachment 120659 [details]
evemu-describe

Emm, but 0.16.0 doesn't fix my problem.
Attach the evemu-describe output of the problematic device.
Comment 3 Peter Hutterer 2015-12-23 04:30:30 UTC
Ok, different bug. The problem with this device is that it announces a multitouch X axis but no Y axis. Needs a custom workaround, I need to look into this.
Comment 4 Peter Hutterer 2015-12-23 06:04:36 UTC
Created attachment 120660 [details] [review]
https://bugs.freedesktop.org/show_bug.cgi?id=93474

give this one a try please
Comment 5 Weng Xuetian 2015-12-23 06:15:40 UTC
(In reply to Peter Hutterer from comment #4)
> Created attachment 120660 [details] [review] [review]
> https://bugs.freedesktop.org/show_bug.cgi?id=93474
> 
> give this one a try please

Thank you very much! Now it works :D
Comment 7 Peter Hutterer 2016-01-11 23:31:36 UTC
commit 988cfda42c5613edb871d0ee7a2332fc9668c84c
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Wed Dec 23 15:15:29 2015 +1000

    evdev: only reject devices with missing MT x/y if they're MT devices


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.