lib-input is the typed no_std client helper library for inputd.
Find a file
Erik Inkinen 27b21c975d
All checks were successful
CI / test (push) Successful in 5s
lib-input: drop unstable rustfmt options for stable toolchains
2026-03-23 10:19:54 +02:00
.github phase3-input: implement input client helper library 2026-03-11 12:16:36 +02:00
src phase3-input: implement input client helper library 2026-03-11 12:16:36 +02:00
.editorconfig Initial commit 2026-03-11 10:15:25 +01:00
.gitignore Initial commit 2026-03-11 10:15:25 +01:00
ARCHITECTURE.md phase3-input: document lib-input API and contracts 2026-03-11 14:13:34 +02:00
Cargo.toml phase3-input: implement input client helper library 2026-03-11 12:16:36 +02:00
CODE_OF_CONDUCT.md Initial commit 2026-03-11 10:15:25 +01:00
CONTRIBUTING.md Initial commit 2026-03-11 10:15:25 +01:00
LICENSE Initial commit 2026-03-11 10:15:25 +01:00
README.md phase3-input: document lib-input API and contracts 2026-03-11 14:13:34 +02:00
ROADMAP.md phase3-input: document lib-input API and contracts 2026-03-11 14:13:34 +02:00
rustfmt.toml lib-input: drop unstable rustfmt options for stable toolchains 2026-03-23 10:19:54 +02:00
SECURITY.md Initial commit 2026-03-11 10:15:25 +01:00

lib-input

lib-input is the typed no_std client helper library for inputd.

It provides a normalized key/pointer event model and strict IPC helper functions for appending events and reading routed events/status.

What it does

  • Defines normalized event types:
    • InputEventV1::Key(KeyEventV1)
    • InputEventV1::Pointer(PointerEventV1)
  • Validates source role, endpoint slot, event-kind fields, and pointer button masks.
  • Implements transport-callback helpers:
    • append_event(...)
    • read_event(...)
    • read_status(...)
  • Enforces strict request/response identity and operation-id checks.

IPC contracts used

lib-input targets inputd v1 contracts in lib-ipc:

  • IPC_PHASE3_INPUTD_OP_APPEND_EVENT (0x5D0)
  • IPC_PHASE3_INPUTD_OP_READ_EVENT (0x5D1)
  • IPC_PHASE3_INPUTD_OP_READ_STATUS (0x5D2)

Body IDs and layout checks are delegated to lib-ipc parse/encode helpers.

Runtime model

  • Allocation-free API surface.
  • Caller-supplied transport callback.
  • Deterministic error model (Error enum) with explicit categories for transport, framing, and payload validation failures.

Build and test

cargo fmt --all -- --check
cargo clippy --all-targets --all-features -- -D warnings
cargo test --all-targets --all-features

Dependencies

  • lib-bootstrap
  • lib-ipc

No third-party crates are used.