Listen to input from core pointer/keyboard devices

Andrey Pokrovskiy wonder.mice at gmail.com
Mon Feb 9 23:50:30 PST 2009


On Tue, Feb 10, 2009 at 12:30 AM, Peter Hutterer
<peter.hutterer at who-t.net> wrote:
> Doesn't synergy just grab the pointer and warp it back into the middle? That
> would make the most sense, certainly more than registering for events on each
> window.

No. Synergy grabs pointer and warps it back only when controlling
remote (other) display. When controlling "primary" display (machine to
which keyboard and pointer device attached) it selects MotionNotify
and CreateNotify for each window and listens to pointer motion - when
it reaches the edge of "primary" display, Synergy begins to control
remote display, so it grabs the pointer (on primary display) and warps
it back on every move.

>> So, the question can be devided on two parts:
>> 1. Is there any way to select X pointer/keyboard (core devices) events?
>> 2. Maybe there is more direct/simple/right way to do what I need?
>
> You can't do it, in the end, you'll always lose because of grabs. What do you
> need it for?

I need it for functionality similar to Synergy. When pointer reaches
edge of the screen, it moves to another screen (that can be on this or
another machine) according to special rules. I can't use Synergy
because of its license and because it uses TCP/IP as transport (which
is not always needed/available in my case).

As I see the only way for me now is to write one another X extension.
I wonder, why XFREE-DGA extension (that always receives events from
core devices on server side) can't send events to clients until mode
will be set, frame buffer will be allocated and all this stuff will be
properly initialized. I see no problem for DGA to always send its
Motion/Buttons events if client selected them.

MPX can be a nice place to do it gracefully, but as I understand it
has no client side API.


More information about the xorg-devel mailing list