Handling of USB device buttons

2012-08-19 Thread Alex Dubov
Greetings.

___
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: http://lists.x.org/mailman/listinfo/xorg
Your subscription address: arch...@mail-archive.com


Consistent handling of USB device buttons

2012-08-19 Thread Alex Dubov
Hi,

Sorry for my previous mis-posting, there appears to be some problem with gmane
interface.

There exist considerable number of hot-pluggable USB devices with helper buttons
(cameras and headsets being the more prominent examples). The buttons in
question are recognized by evdev as USB HID interfaces, so in theory they are
considered as "supported".

In practice, however, there are 2 common problems:

1. Buttons have session global effect and there's no easy, nor stable way to
limit their effect to a particular device.

2. Sometimes device buttons are recognized as "mice", rather than "keyboards"
and there's no much one can do with "mouse" buttons out of Xorg box (assorted
third party programs of varying breed and maintenance status notwithstanding).

I tried to make some sense of the issue for myself, but it appears to be
impossible to get through untold scores of various user complains on the
inter-webs. :-)

Can somebody point me at an information or discussions regarding the issues
above? After all, those devices are abundant and appear to work just fine even
on older windows xp, without any extraneous effort.

It seems logical to me that USB buttons must represent a whole input device
class on their own, with appropriate events defined. I suppose, it won't be a
big deal to incorporate support for them into existing applications, because the
need for such arrangement is long and widely recognized by anybody who tried to
rely on such buttons on Linux.

Regards,
Alex

___
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: http://lists.x.org/mailman/listinfo/xorg
Your subscription address: arch...@mail-archive.com


Re: Consistent handling of USB device buttons

2012-08-21 Thread Alex Dubov
Peter Hutterer  who-t.net> 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.

> 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].

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).

Regards,
Alex

> 
> Cheers,
>Peter
> 


___
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: http://lists.x.org/mailman/listinfo/xorg
Your subscription address: arch...@mail-archive.com


Re: Consistent handling of USB device buttons

2012-08-21 Thread Alex Dubov
> 

> 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.

Thanks a lot.
This is exactly the piece of information I was looking for.

> 
> 
> file this as bug and attach an evemu recording, I'll have a look at it.
> http://people.freedesktop.org/~whot/evemu/

Yep, created

https://bugs.freedesktop.org/show_bug.cgi?id=53907

Regards,
Alex
___
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: http://lists.x.org/mailman/listinfo/xorg
Your subscription address: arch...@mail-archive.com