1
1
Fork
You've already forked evfwd
0
A tool for forwarding events from evdev devices using uinput
  • Go 100%
2024年10月28日 15:06:28 -07:00
go.mod initial import 2024年10月21日 10:41:47 -07:00
go.sum initial import 2024年10月21日 10:41:47 -07:00
main.go Add escape key support, unclutter Usage output 2024年10月28日 14:50:44 -07:00
README.md README tweaks 2024年10月28日 15:06:28 -07:00

evfwd is a simple tool to forward evdev events to a new virtual device.

evfwd can run in client or server mode and typically it is used by piping the client's output into a server running on another host.

In client mode evfwd reads events from one or more evdev devices and serializes them to stdout using Go's gob format. On the server side it reads these serialized events from stdin and injects them into /dev/uinput virtual devices. During the initial handshake the client passes on the evdev device descriptions and the server uses this information to clone the devices. evfwd tries to filter capabilities that would require two way communication but other than that it doesn't know anything about specific device types (keyboard, mouse etc) it simply forwards all events.

Example use to tunnel events through ssh to a remote machine:

evfwd /dev/input/somedevice | ssh somehost evfwd -s

You can list multiple devices in which case all of them will be watched.

Normally in client mode evfwd doesn't grab the device so the input continues to arrive to local programs too. To avoid this you can use the -g (grab) flag.

In client mode evfwd will watch for an event type and code combination that causes it to exit. By default the escape event type is 1 (EV_KEY) and the event code is 88 (F12 key). This means that pressing the F12 key on one of the watched devices will cause evfwd to exit. This is particularly important when grabbing your main keyboard device since otherwise you might not have an easy way to release the keyboard. The event type and code can be overridden using the -t and -e flags. You can find the event types and codes using the evtest utility.

The -l flag lists available input devices.

The client requires read permission to the input devices and the server side requires write permission to /dev/uinput.