sending mouse events to another Xorg server
Peter Hutterer
peter.hutterer at who-t.net
Mon May 8 00:27:28 UTC 2017
On Fri, May 05, 2017 at 08:19:04AM +0200, Matthias Apitz wrote:
> El día viernes, mayo 05, 2017 a las 01:39:59p. m. +1000, Peter Hutterer escribió:
>
> > On Wed, May 03, 2017 at 07:23:38AM +0200, Matthias Apitz wrote:
> > >
> > > I'm thinking in a X11-client running on the 2nd laptop
> > > having a small grey window only (or even a tiny picture from
> > > the TV's picture, but grey would be enough) and when the mouse
> > > of the Xorg server enters this grey area, all mouse movements
> > > and button clicks are populated to the Xorg and the 1st laptop
> > > as the would have been done on its physical touchpad, something
> > > like the xev(1) client, which protocols the mouse actions, in
> > > the case of xev(1), to stdout.
> > >
> > > Is there any way to do so?
> >
> > look at synergy or x2x
>
> Peter,
>
> Thanks for the pointer to 'synergy'. I watched some video on its home
> page and it looks pretty cool.
>
> Yesterday I hacked down, based on the source of X11' xev(1) application,
> some first testclient which also worked and let me last night crontrol
> the firefox live streams on the remote host and on its connected TV
> screen. Just for the records, it goes mostely like this:
>
> from the modified xev.c:
>
> ...
> Display *dpy;
> Display *rdpy; /* the remote display, i.e. the remote TV */
>
> /* TV-control implemented 'xtele' (based on X11' xev(1))
> *
> * the idea: control from some laptop screen (1366x768) the full screen
> * application running on the external VGA display of some other laptop; the
> * picture is like this:
> *
> * +--------------------+ +--------------------++--------------------+
> * | | | || |
> * | | | || |
> * | 1366 x 768 |=====>| 1366 x 768 || 1920 x 1080 |
> * | | | LCD1 || VGA1 |
> * | | | || |
> * +--------------------+ +--------------------+| |
> * | |
> * | |
> * +--------------------+
> *
> * this means:
> * - we must map the area 1366x768 to 1920x1080, i.e. by a RATIO of 1.4
> * - we must right shift the X,Y by adding a SHIFT of 1366 to X value
> * - note: the controlling app 'xtele' has an upper border of 20 px, added by the
> * local window manager; so we must add a an UP shift of -20 px
> * XXX: can we still reach the TV controls at the button of a full screen running?
I really recommend not writing this yourself, unless it's just for fun or
for a learning experience. There's quite a few nasty details like when/how
to get all events, how to forward relative data correctly, detecting screen
switches, etc. that are just a time sink.
Cheers,
Peter
More information about the xorg
mailing list