[Xorg] source of input

Joe Krahn krahn at niehs.nih.gov
Wed Jul 21 09:46:20 PDT 2004

Matthew Evan Fowle wrote:
> i've been trying to write a multi-user window manager, sort of a x2x or
> synergy in reverse, but i cannot get off the ground: i am unable to find
> any means to detect which input source an input event was
> generated with.
You need to open the 2nd mouse as an extension device, and receive
extension events rather than pointer events. The 2nd mouse should also
be configured not to send core events (no AlwaysCore option).

> my goal is to be able to seperate the different input sources from one
> another.  so i could have, for example, two mice, each with their own
> distinct cursor.  i'm willing to implement a crude hack to share a
> CorePointer between two "fake" cursors (the "window manager"), but I have
> been unable to find any means to differentiate input between the two mice.
> if anyone has suggestions for how I can go about finding what physical
> device an input event (Motion, keyboard, or otherwise) was generated from,
> i would be very much oblidged.
There is now way to find what device an event came from, because the
XInput design never included support for more than one physical device
for one effective device. The "AlwaysCore" is just a hack.

Of course, with an extension device, it is up to you to draw a
cursor, manage the sub-windows, track window focus, and send
keyboard/pointer events to the appropriate sub-windows.

Joe Krahn

More information about the xorg mailing list