Consistent handling of USB device buttons

Peter Hutterer peter.hutterer at
Tue Aug 21 17:23:02 PDT 2012

On Tue, Aug 21, 2012 at 05:54:18AM +0000, Alex Dubov wrote:
> Peter Hutterer <peter.hutterer <at>> writes:
> > > 
> > > 1. Buttons have session global effect and there's no easy, nor stable way
> > > to limit their effect to a particular device.
> > 
> > I don't understand this bit. can you paraphrase?
> For example, if I press a button on a headset and say it maps to
> "XF86VolumeUp", how does the mixer application is supposed to know
> which channel to adjust? I would expect it to only affect the headset, not
> the "master" channel which is normally set to built-in audio card.

use XI2 and deviceid in events, then you know that the volume up was hit on
this particular device. clients may not make use of this right now, but the
infrastructure is in place.

> > evdev will set up BTN_0...BTN_TASK as buttons on a device. anything else
> > should be a keyboard. especially KEY_CAMERA should be a key. what specific
> > device has the camera button set up as mouse button?
> My most recent problem was with Plantronics Audio 648 USB headset (works on
> XP out of the box). It's got 4 buttons ["call", "volume up", "volume down"
> and "mic mute"], which for some reason are mapped by evdev to mouse buttons
> [8, 3, 2, 1].

file this as bug and attach an evemu recording, I'll have a look at it.


> As per point 1 above, mouse button presses generated by headset seem
> indistinguishable from normal mouse key presses when applications are
> concerned (with expected funny results).

More information about the xorg mailing list