Lua bindings for Linux evdev input devices and /dev/uinput virtual devices.
Check out the documentation for guides and examples.
- Device Discovery: List and search for connected input devices by name, path, or physical location.
- Event Stream: Read kernel input events with high-resolution timestamps.
- Virtual Devices: Emulate any hardware input device (mouse, keyboard, gamepad) programmatically via uinput.
- Event Selector: Poll multiple devices concurrently in a single non-blocking event loop.
- Multiple Lua Versions: Compatible with LuaJIT, Lua 5.1, 5.2, 5.3, 5.4, and 5.5.
luarocks install bluelua-evdevlocal evdev = require "evdev"
local dev = assert(evdev.device.open("/dev/input/event0"))
for event in dev:events() do
if evdev.events.is_press(event) then
print("Key pressed: " .. event. code)
end
end