From 650540b9d706fc37f5d53311a0c5b2769b0cd453 Mon Sep 17 00:00:00 2001 From: haithium <128622475+haithium@users.noreply.github.com> Date: Fri, 19 Jun 2026 18:50:51 +0000 Subject: [PATCH] docs: generate docs for evdev --- docs/src/evdev/api/ecodes.md | 47 ------------------------------------ docs/src/evdev/types.md | 22 +++++++++++++---- 2 files changed, 17 insertions(+), 52 deletions(-) delete mode 100644 docs/src/evdev/api/ecodes.md diff --git a/docs/src/evdev/api/ecodes.md b/docs/src/evdev/api/ecodes.md deleted file mode 100644 index 2135451..0000000 --- a/docs/src/evdev/api/ecodes.md +++ /dev/null @@ -1,47 +0,0 @@ -# `ecodes` - -Linux input event code constants used when reading events from `/dev/input` or -emitting events through `uinput`. - -## Usage - -```lua -local evdev = require "evdev" - -local Device = evdev.device.open -local dev = assert(Device("/dev/input/event3")) - -for e in dev:events() do - if e.type == evdev.ecodes.EV_KEY and e.code == evdev.ecodes.KEY_ENTER then - print("Enter key event", e.value) - end -end -``` - -## [`EV`] - -Event type constants used in the `type` field of Linux input events. - -## [`SYN`] - -Synchronization constants used to separate or mark input event packets. - -## [`REL`] - -Relative axis constants used with `EV_REL` events, such as mouse movement and -wheel input. - -## [`BTN`] - -Button constants used with `EV_KEY` events for mouse, joystick, gamepad, tablet, -and other button-like inputs. - -## [`KEY`] - -Keyboard and consumer key constants used with `EV_KEY` events. - -[`EV`]: ../types#ev -[`SYN`]: ../types#syn -[`REL`]: ../types#rel -[`BTN`]: ../types#btn -[`KEY`]: ../types#key diff --git a/docs/src/evdev/types.md b/docs/src/evdev/types.md index f902a8f..83c39fc 100644 --- a/docs/src/evdev/types.md +++ b/docs/src/evdev/types.md @@ -53,7 +53,9 @@ Input device metadata. | `vendor` | `integer` | No | Vendor ID from the kernel input ID. | | `version` | `integer` | No | Hardware version from the kernel input ID. | -## [`evdev.ecodes.btn`](https://github.com/BlueLua/evdev/blob/main/types/_enums.d.lua#L9-L134) +## [`evdev.ecodes.btn`](https://github.com/BlueLua/evdev/blob/main/types/_enums.d.lua#L5-L134) + +Button codes (e.g. mouse buttons, joysticks, gamepads). | Name | Value | | --------------------- | ----- | @@ -181,7 +183,10 @@ Input device metadata. | `BTN_Y` | `308` | | `BTN_Z` | `309` | -## [`evdev.ecodes.ev`](https://github.com/BlueLua/evdev/blob/main/types/_enums.d.lua#L140-L156) +## [`evdev.ecodes.ev`](https://github.com/BlueLua/evdev/blob/main/types/_enums.d.lua#L136-L156) + +Event types (e.g. key press, relative movement, absolute position, +synchronization). | Name | Value | | -------------- | ----- | @@ -200,7 +205,9 @@ Input device metadata. | `EV_SW` | `5` | | `EV_SYN` | `0` | -## [`evdev.ecodes.key`](https://github.com/BlueLua/evdev/blob/main/types/_enums.d.lua#L162-L688) +## [`evdev.ecodes.key`](https://github.com/BlueLua/evdev/blob/main/types/_enums.d.lua#L158-L688) + +Keyboard key codes. | Name | Value | | ------------------------------ | ----- | @@ -729,7 +736,9 @@ Input device metadata. | `KEY_ZOOMOUT` | `419` | | `KEY_ZOOMRESET` | `420` | -## [`evdev.ecodes.rel`](https://github.com/BlueLua/evdev/blob/main/types/_enums.d.lua#L694-L711) +## [`evdev.ecodes.rel`](https://github.com/BlueLua/evdev/blob/main/types/_enums.d.lua#L690-L711) + +Relative axis codes (e.g. mouse movement, scroll wheels). | Name | Value | | ------------------- | ----- | @@ -749,7 +758,10 @@ Input device metadata. | `REL_Y` | `1` | | `REL_Z` | `2` | -## [`evdev.ecodes.syn`](https://github.com/BlueLua/evdev/blob/main/types/_enums.d.lua#L717-L725) +## [`evdev.ecodes.syn`](https://github.com/BlueLua/evdev/blob/main/types/_enums.d.lua#L713-L725) + +Synchronization event codes used to group events or signal device status +changes. | Name | Value | | --------------- | ----- |