atomcode_tuix/input/mod.rs
1// crates/atomcode-tuix/src/input/mod.rs
2pub mod history;
3pub mod key_action;
4pub mod reader;
5
6use crossterm::event::KeyEvent;
7
8/// Events the input thread sends to the main async loop.
9#[derive(Debug, Clone)]
10pub enum InputEvent {
11 /// A key was pressed (raw mode).
12 Key(KeyEvent),
13 /// A bracketed-paste payload arrived.
14 Paste(String),
15 /// Stdin closed (reader thread exiting).
16 Eof,
17 /// Terminal window resized; carries the new `(cols, rows)`.
18 /// The event loop forwards this to the renderer so the DECSTBM
19 /// scroll region can re-flow to the new height (footer stays
20 /// pinned at `[H - footer_rows + 1, H]`).
21 Resize(u16, u16),
22 /// Mouse scroll wheel. `delta` lines: negative = up (older
23 /// content), positive = down (newer). Only emitted when the
24 /// active renderer has enabled mouse capture (currently
25 /// AltScreenRenderer only — RetainedRenderer relies on host-
26 /// terminal scrollback, PlainRenderer doesn't pin a UI).
27 MouseScroll(i32),
28 /// Mouse primary button pressed at terminal cell `(col, row)`.
29 MouseDown { col: u16, row: u16 },
30 /// Mouse drag moved to terminal cell `(col, row)`.
31 MouseDrag { col: u16, row: u16 },
32 /// Mouse primary button released.
33 MouseUp,
34}