Blub / netevent

Input-Event device cloning utility. Use it together with ssh/netcat/... to share input devices among different machines.
GNU General Public License v2.0
148 stars 14 forks source link

netevent

Netevent is a tool which can be used to share linux event devices with other machines (either via /dev/uinput or by implementing a client for the same protocol with other means).

Originally it simply dumped device capabilities to stdout and afterwards behaved like running cat /dev/input/eventX in one mode, and in the other passed the parsed capabilities to /dev/uinput and then passing events through.

Since managing this for multiple devices can become tedious when having more than one destination (and since the original grab/toggle/hotkey mechanisms were weird and literally targeted my personal use case), netevent2 now extends the protocol to contain packets which can contain more than one device and can add and remove devices on the fly.

The original cat like behavior (although currently without hotkey support) is also available for debugging purposes (and the create mode supports both protocol versions).

The main tool is now the netevent daemon which has a command socket (an optionally abstract unix socket) via which one can add devices, outputs and hotkeys on the fly. See the examples below.

Compilation

You can still just run make as before. However, to support the usual installation workflows, and to distinguish between systems with newer kernels where /dev/uinput has been extended with a UI_DEV_SETUP ioctl, a ./configure script has been added to check for this and create a config.h as well as a config.mak for PREFIX/BINDIR/... (all of which can be passed as variables directly to make instead as well, along with the usual DESTDIR).

Installation

Or: as previously, just put the netevent binary wherever.

Usage

See the DAEMON COMMANDS section in netevent(1) for details on the commands used in the setup scripts below.

Examples

See the examples/ directory. Read the setup-example below to see how to adapt the hotkey lines to work with your devices.

Simple example setup: sharing keyboard & mouse with a machine via ssh:

Host side:

You can now send additional commands to the daemon by connecting to the socket. For example via socat READLINE UNIX-CONNECT:netevent-command.sock.