You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
evdev is a libevdev inspired Go package for working with Linux input
devices. evdev works by making ioctl system calls for the Linux
input and uinput subsystems. Because evdev is written in pure
Go, it can be used without CGO.
evdev is used to poll events from, and send events to /dev/input/event*
devices. Additionally, evdev provides the ability to create virtual uinput
devices that can be used similarly.
evdev is a rewrite of the github.com/jteeuwen/evdev package. Most of
the credit for this package goes to jteeuwen for the original (and amazing!)
work done.
Installing
evdev can be installed in the usual Go fashion:
$ go get -u github.com/kenshaw/evdev
Using
Please see the examples directory for more examples.
Permission Issues
Reading events from input devices or creating virtual uinput devices requires
$USER to have the appropriate system-level permissions. This can be accomplished
by adding $USER to a group with read/write access to /dev/input/event* and
uinput block devices.
Please refer to your relevant Linux distribution's documentation on adding
$USER to the appropriate system group, or otherwise allowing read/write
access to /dev/input/event* and uinput devices.
Note: if adding a group to the current $USER, it will be necessary to log
out and log back in before the system recognizes the group membership.
Ubuntu/Debian
On Ubuntu/Debian systems, the current $USER can be added to the input
group:
$ sudo adduser $USER input
About
Package evdev provides input and uinput handling on Linux.