textual_rs/event/mod.rs
1//! Event system: application events, message passing, key bindings, and timers.
2
3pub mod dispatch;
4pub mod keybinding;
5pub mod message;
6pub mod timer;
7
8// Re-export key types
9pub use dispatch::dispatch_message;
10pub use keybinding::KeyBinding;
11pub use message::Message;
12
13use crossterm::event::{KeyEvent, MouseEvent};
14
15/// Events flowing through the application event bus.
16#[derive(Debug, Clone)]
17pub enum AppEvent {
18 /// A keyboard event from the terminal.
19 Key(KeyEvent),
20 /// A mouse event from the terminal.
21 Mouse(MouseEvent),
22 /// Terminal was resized to (columns, rows).
23 Resize(u16, u16),
24 /// Reserved for periodic tick events from spawn_tick_timer.
25 Tick,
26 /// Reactive signal change detected — triggers a render pass.
27 RenderRequest,
28 /// Application has requested a clean exit.
29 Quit,
30}