Listen to input from core pointer/keyboard devices

Peter Hutterer peter.hutterer at who-t.net
Tue Feb 10 00:55:59 PST 2009


On Tue, Feb 10, 2009 at 10:50:30AM +0300, Andrey Pokrovskiy wrote:
> 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).

It may be worth looking at x2x. IIRC, it puts up an InputOnly window on the
edge of the screen and waits for EnterNotify events.

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

DGA is hopefully going away soon.
 
> MPX can be a nice place to do it gracefully, but as I understand it
> has no client side API.

The client-side API for MPX is XI 2 (X Input Extension v2) and it will
actually provide exactly that feature (relative motion events).
But you will have to hold out until 1.7.

Cheers,
  Peter


More information about the xorg-devel mailing list