1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// Copyright (c) 2024-2025 R3BL LLC. Licensed under Apache License, Version 2.0.
//! Terminal I/O abstractions for input devices, output devices, and events.
//!
//! This module provides a unified interface for terminal input/output operations,
//! abstracting over different backends ([`CrosstermInputDevice`],
//! [`DirectToAnsiInputDevice`]).
//!
//! # Key Types
//!
//! - [`InputDevice`] - Trait for async input event streams
//! - [`InputEvent`] - Unified event type (keyboard, mouse, resize, etc.)
//! - [`KeyPress`] - Keyboard input with key code and modifiers
//! - [`ModifierKeysMask`] - Bitflags for Shift, Ctrl, Alt, etc.
//! - [`MouseInput`] - Mouse events (click, scroll, move)
//!
//! # Testing
//!
//! Backend compatibility tests live in `backend_compat_tests` (test-only module). These
//! PTY-based tests verify that [`DirectToAnsiInputDevice`] and [`CrosstermInputDevice`]
//! produce identical [`InputEvent`] values for the same ANSI byte sequences.
//!
//! Run the tests with:
//!
//! ```bash
//! cargo test -p r3bl_tui --lib test_pty_backend -- --nocapture
//! ```
//!
//! [`CrosstermInputDevice`]: crate::CrosstermInputDevice
//! [`DirectToAnsiInputDevice`]: crate::direct_to_ansi::DirectToAnsiInputDevice
//! [`InputDevice`]: crate::InputDevice
//! [`InputEvent`]: crate::InputEvent
//! [`KeyPress`]: crate::KeyPress
//! [`ModifierKeysMask`]: crate::ModifierKeysMask
//! [`MouseInput`]: crate::MouseInput
// Private modules (hide internal structure).
// Re-exports for flat public API.
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
// Backend compatibility tests (Linux-only PTY tests).
// Public for docs and tests so intra-doc links resolve.