We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 89fbf6c commit 4722a4aCopy full SHA for 4722a4a
1 file changed
types/device.d.lua
@@ -247,6 +247,24 @@ function Device:read() end
247
---@return string? err Error message on failure.
248
function Device:flush() end
249
250
+---
251
+---Query and monitor physical Linux input devices.
252
253
+---```lua
254
+---local evdev = require "evdev"
255
256
+----- Find and open the primary keyboard
257
+---local dev = assert(evdev.device.open("/dev/input/event0"))
258
+---print("Opened device: " .. dev.name)
259
260
+----- Process events in a loop
261
+---for event in dev:events() do
262
+--- if evdev.events.is_press(event) then
263
+--- print("Key Pressed! Code: " .. event.code)
264
+--- end
265
+---end
266
+---```
267
268
---@class evdev.device
269
local M = {}
270
0 commit comments