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.
- Mouse
Event - Mouse input event.
Enums§
- Event
- Terminal input event.
- KeyCode
- Keyboard key codes.
- KeyEvent
Kind - 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.
- Modifier
Key - A modifier key pressed as a standalone key event, independent of the
KeyModifiersflags carried on non-modifier key events. - Mouse
Button - Mouse button identifiers.
- Mouse
Event Kind - Kinds of mouse events.
- System
Theme - The system’s light/dark color-scheme preference, as reported by the windowing/browser layer.
Functions§
- coalesces_
with - Whether
newshould replace the queue’s current tail event instead of being pushed alongside it, when a backend is appendingnewto aVec/VecDequeof pending events.
Type Aliases§
- Physical
Pos - Physical (pixel) position relative to the window’s top-left corner.