term only.Expand description
Asynchronous terminal events.
EventStream uses the active Compio runtime. Linux uses Compio’s managed
multishot read operation. Other Unix systems use the Compio polling driver
when stdin is a terminal. If stdin is redirected, they use Compio timers
with nonblocking rustix reads from /dev/tty. Windows uses a Compio event
wait and ReadConsoleInputW. No backend starts a helper thread.
Event values and event-control commands are re-exported from Crossterm. Code
that already matches on Event, KeyCode, or MouseEvent can use
the same values with this stream.
Terminal input is normally line buffered. Enable raw mode before reading individual key events. Mouse, focus, bracketed-paste, and enhanced keyboard events also require their corresponding Crossterm command to be enabled.
Structs§
- Disable
Bracketed Paste bracketed-paste - A command that disables bracketed paste mode.
- Disable
Focus Change - A command that disables focus event emission.
- Disable
Mouse Capture - A command that disables mouse event capturing.
- Enable
Bracketed Paste bracketed-paste - A command that enables bracketed paste mode.
- Enable
Focus Change - A command that enables focus event emission.
- Enable
Mouse Capture events - A command that enables mouse event capturing.
- Event
Stream - A local asynchronous stream of terminal events.
- KeyEvent
- Represents a key event.
- KeyEvent
State - Represents extra state about the key event.
- KeyModifiers
- Represents key modifiers (shift, control, alt, etc.).
- Keyboard
Enhancement Flags - Represents special flags that tell compatible terminals to add extra information to keyboard events.
- Mouse
Event - Represents a mouse event.
- PopKeyboard
Enhancement Flags - A command that disables extra kinds of keyboard events.
- Push
Keyboard Enhancement Flags - A command that enables the kitty keyboard protocol, which adds extra information to keyboard events and removes ambiguity for modifier keys.
Enums§
- Event
- Represents an event.
- KeyCode
- Represents a key.
- KeyEvent
Kind - Represents a keyboard event kind.
- Media
KeyCode - Represents a media key (as part of
KeyCode::Media). - Modifier
KeyCode - Represents a modifier key (as part of
KeyCode::Modifier). - Mouse
Button - Represents a mouse button.
- Mouse
Event Kind - A mouse event kind.