From fbf47153f30fd7eb30ab9c4b71b5e3e5f9f23b53 Mon Sep 17 00:00:00 2001 From: RunasSudo Date: Thu, 21 Nov 2019 23:48:56 +1100 Subject: [PATCH] Update README.md --- README.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/README.md b/README.md index 35d1d77..44cfc5f 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,37 @@ # input-over-ssh Mouse and keyboard forwarding over SSH, using *xinput* and *xdotool*, with relative mouse movement. A useful adjunct to VNC in situations where relative mouse movement is important, e.g. 3D video games. + +## Dependencies + +* Client (sending the mouse and keyboard of this device) + * *xinput* – to monitor mouse and keyboard + * *unclutter* from *unclutter-xfixes-git* – to hide cursor +* Server (mouse and keyboard sent to this device) + * *xdotool* – to send mouse and keyboard events + +## Configuration + +In *forward.py*, `MOUSEHOLD_X` and `MOUSEHOLD_Y` define the location at which the mouse cursor will be centered. Each frame, the client-side cursor will be reset to this position to measure relative movement. If `MOUSEHOLD_W` and `MOUSEHOLD_H` are non-zero, a Tkinter window of the given dimensions will be drawn around that location to prevent clicks interfering with other applications. + +`DEVICE_MOUSE` and `DEVICE_KEYBOARD` give the names of the keyboard and mouse devices to monitor, as shown in the output of `xinput list`. + +## Usage + +To run the script, pipe the output to SSH, ensuring that Python output is unbuffered using the `-u` flag: + +``` +python -u forward.py | ssh hostname.example.com bash +``` + +To exit, simply press Ctrl+Q. + +## Combining with VNC + +This setup is easily combined with VNC in view-only mode to provide a full GUI experience. + +On the host, disable the CursorPosUpdates/CursorShapeUpdates VNC extensions to force the server to directly render the cursor. For *x11vnc*, simply pass the `-nocursorpos -nocursorshape` flags. + +On the client, enable view-only mode to prevent conflict between the VNC client and input-over-ssh. For TigerVNC *vncviewer*, simply pass the `ViewOnly=1` flag. + +Then run input-over-ssh as usual, and you should be able to control the remote cursor. This provides a lightweight, open-source alternative to services like Steam Remote Play.