Skip to main content

Module event

Module event 

Source
Expand description

Input event system.

Terminal::poll returns an optional Event with support for keyboard (KeyEvent, all standard keys plus KeyModifiers), mouse (MouseEvent: buttons, movement, scroll), touch (synthesized into the same mouse events on the software/WASM backend), window resize, and close events. has_input checks for a pending event without blocking. Resize events are applied to the grid automatically, before the event reaches your code.

Structs§

KeyEvent
Keyboard input event.
KeyModifiers
Keyboard modifier flags.
KeyState
Tracks which keys are currently held down.
MouseEvent
Mouse input event.

Enums§

Event
Terminal input event.
KeyCode
Keyboard key codes.
KeyEventKind
Whether a key event is a press, an auto-repeat, or a release.
KeyLocation
The physical location of a key on the keyboard, for keys that appear in more than one place.
ModifierKey
A modifier key pressed as a standalone key event, independent of the KeyModifiers flags carried on non-modifier key events.
MouseButton
Mouse button identifiers.
MouseEventKind
Kinds of mouse events.
SystemTheme
The system’s light/dark color-scheme preference, as reported by the windowing/browser layer.

Functions§

coalesces_with
Whether new should replace the queue’s current tail event instead of being pushed alongside it, when a backend is appending new to a Vec/VecDeque of pending events.

Type Aliases§

PhysicalPos
Physical (pixel) position relative to the window’s top-left corner.