rjshaw at netspace.net.au
Thu Nov 4 19:48:57 PDT 2010
On 05/11/10 10:21, Peter Hutterer wrote:
> On Thu, Nov 04, 2010 at 10:35:29PM +1100, Russell Shaw wrote:
>> In XInput2, when i get a XI_HierarchyChanged event after plugging in
>> another mouse, is there a way to get a unique identifier for each device
>> such as a brand and model number?
> no, the device ID is unfortunately the only identifier you have.
> model/vendor information, etc. isn't exported by any driver yet.
>> When i start my program that uses two mice for different functions
>> (one in each hand), it would be useful for them both to be assigned
>> the correct role whenever the program is started, regardless of
>> whatever other devices have been plugged in since the last session.
A unique ID would be useful.
I found this in linux-188.8.131.52/drivers/input/evdev.c:
if (_IOC_NR(cmd) == _IOC_NR(EVIOCGUNIQ(0)))
return str_to_user(dev->uniq, _IOC_SIZE(cmd), p);
It was not clear how to integrate it in to xf86-input-evdev/src/evdev.c
When i start a program that uses a left-hand puck (i'm using a mouse) and
a normal right-hand mouse, i'll have to make a pop-up widget appear every
time so that the user can choose which mouse does what. It would be good
if the application can store the settings for a unique device id.
I used to use this mouse and puck arrangement around 1990 on a Human
Interface Loop Bus (HIL Bus) on a HP 9000 Apollo workstation. It was
a standard way of running CAD programs and greatly reduced mouse-finger
fatigue. The software was killed for political reasons, but the useability
was far better than the toy Windows stuff around now.
More information about the xorg