Expand description
Keyboard, pointer and touch input.
Two halves that are useful apart. Keyboard compiles an xkb keymap and
turns evdev keycodes into keysyms and text; the libinput side reads the
devices those codes come from. A caller with its own event source – a
remote protocol, a test harness, a replay – wants the first without the
second, so they are separate and each is behind its own feature.
§Features
xkb (default) brings in Keyboard; libinput (default) brings in
Seat. Without either, the event types, Repeat and KeyRepeater
still build and test – which is what a cross target with neither library
in its sysroot can do.
§Not here
SeatOptions::log_handler, the reference’s per-seat sink for libinput’s
diagnostics. libinput carries one user_data slot per context and the
input crate has already spent it on the device opener, so a per-context
sink would need a registry keyed on the context pointer – for a hook
whose stated purpose is separating libinput’s stream from the library’s
own, which drmkit_log::set_log_sink can already do process-wide.
SeatOptions::log_priority still gates how much libinput says.
The Pointer accumulator and EventDispatcher. The first turns relative
motion into a position, which needs a screen extent to clamp against and
belongs where that is known; the second is a list of callbacks, which is
what a caller writes around a Vec of events anyway.
Structs§
- KeyEvent
- A key going down or coming up.
- KeyRepeater
- Auto-repeat driven by a timer the caller polls.
- Keyboard
xkb - A keymap and the state of the keys pressed against it.
- Keymap
Names xkb - The names a keymap is compiled from: rules, model, layout, variant, options.
- Leds
- The lock state, as the keyboard’s lights would show it.
- Modifiers
xkb - Which modifiers are in effect.
- Pointer
Absolute - A pointer reporting where it is rather than how far it moved.
- Pointer
Axis - A scroll.
- Pointer
Button - A pointer button going down or coming up.
- Pointer
Motion - A pointer moving.
- Repeat
- Which key is repeating, and what each event does to that.
- Repeat
Config - When a held key starts repeating, and how fast.
- Seat
libinput - Every input device on one seat.
- Seat
Options libinput - What to open.
- Switch
Event - A switch changing.
- Touch
Event - A touch point.
Enums§
- Input
Error - What can go wrong reading input.
- Input
Event - Anything an input device produces.
- LogPriority
libinput - How much libinput should say before this is called at all.
- Pointer
Event - Anything a pointer does.
- Scroll
Source - Where a scroll came from.
- Switch
- Which physical switch changed.
- Timer
- What the timer should do about a key event.
- Touch
Phase - What a touch point is doing.
Traits§
- Libinput
Interface libinput - libinput does not open file descriptors to devices directly,
instead
open_restrictedandclose_restrictedare called for each path that must be opened.