Bug 62831

Summary: Mionix Naos 5000 mouse detected incorrectly
Product: xorg Reporter: Simon Lindgren <simon.n.lindgren>
Component: Input/evdevAssignee: Peter Hutterer <peter.hutterer>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium CC: bugzilla, peter.hutterer
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 55867    
Attachments:
Description Flags
Evtest output
none
0001-Add-option-TypeName-62831.patch none

Description Simon Lindgren 2013-03-27 17:53:11 UTC
Created attachment 77118 [details]
Evtest output

I have a Mionix Naos 5000 mouse, and according to hadess in #control-center, it is getting detected as a keyboard.

Steps to reproduce:
1. Plug the mouse in
2. Go to the mouse & touchpad settings in gnome >= 3.6

Expected result:
Mouse settings should be exposed

Actual result:
There are no mouse settings exposed
Comment 1 Bastien Nocera 2013-03-27 17:59:30 UTC
I'm not certain it gets detected as a keyboard, but it doesn't get tagged with XI_MOUSE, which means that we skipped the mouse section of the "mouse & touchpad" panel.
Comment 2 Bastien Nocera 2013-03-27 21:48:11 UTC
This is the output from xinput that I copied from Simon's pastebin:
⎡ Virtual core pointer                    	id=2	[master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer              	id=4	[slave  pointer  (2)]
⎜   ↳ La-VIEW Technology Naos 5000 Mouse      	id=8	[slave  pointer  (2)]
⎣ Virtual core keyboard                   	id=3	[master keyboard (2)]
    ↳ Virtual core XTEST keyboard             	id=5	[slave  keyboard (3)]
    ↳ Power Button                            	id=6	[slave  keyboard (3)]
    ↳ Power Button                            	id=7	[slave  keyboard (3)]
    ↳ USB Keyboard                            	id=9	[slave  keyboard (3)]
    ↳ USB Keyboard                            	id=10	[slave  keyboard (3)]
Comment 3 Peter Hutterer 2013-03-27 22:35:36 UTC
Looking at the evtest output, it's not surprising. The mouse looks like a keyboard and we tag it as such. Problem here is that there are many _keyboards_ that have the same or roughly the same evtest output. Not sure a generic solution is possible here.
Comment 4 Simon Lindgren 2013-03-28 15:46:55 UTC
This is the product page for the device:
http://mionix.net/products/naos-5000/#specs

A notable feature is a programmable macro function. I suspect this is why keyboard key events are possible. If so, perhaps this problem is not localized to this device, but also present in other "gaming" mice?

I have also seen other devices which might be problematic, like a keyboard with an integrated touchpad. Is it possible for a single device to act like multiple types of devices simultaneously?

(I guess it's possible the mentioned keyboard acts as a usb hub with two devices attached, I wouldn't know about that)
Comment 5 Peter Hutterer 2013-04-02 03:51:00 UTC
(In reply to comment #4)
> I have also seen other devices which might be problematic, like a keyboard
> with an integrated touchpad. Is it possible for a single device to act like
> multiple types of devices simultaneously?

yes, and no :)

yes: devices can send pointer and keyboard events and the server will handle it accordingly.

no: the XI protocol spec allows for only one type-name, so a device will be either keyboard, touchpad, mouse, etc. in it's client-visible declination.

The problem here is largely that we don't know in the driver what a device is solely based on the events it sends. The only way to fix this I can see right now is to have this as a config option that's set in a quirk file.
Comment 6 Peter Hutterer 2013-04-02 04:49:46 UTC
Created attachment 77298 [details] [review]
0001-Add-option-TypeName-62831.patch

Add option TypeName to be used by devices that need a quirk for the auto-assigned type. Example configuration:

Section "InputClass"
    Identifier "trackball type name"
    MatchDriver "evdev"
    MatchProduct "trackball"
    Option "TypeName" "TRACKBALL" # XI_TRACKBALL
EndSection
Comment 7 Peter Hutterer 2013-04-17 03:30:43 UTC
commit b59a1a25dad4437e013ce8d3d65d4591c6f4ee4a
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Tue Apr 2 14:12:26 2013 +1000

    Add option TypeName (#62831)

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.