Core Concepts
- World - A container that holds application state
- Keybindings - Key binding registry with built-in help display
- Focus - Tracks which widget currently has keyboard focus
- Pointer - Tracks widget areas and handles mouse click/drag/up events
- InputEvent - Unified input event handling for keyboard and mouse
//! - [World] - A type-safe container that holds application state and resources
//! - [Keybindings] - Key binding registry with built-in help display
//! - [Focus] - Tracks which widget currently has keyboard focus
//! - [Pointer] - Tracks widget areas and handles mouse click/drag/up events
//! - [InputEvent] - Unified input event handling for keyboard and mouse
Example
const WIDGET_ID: WidgetId = WidgetId;
let mut world = default;
// Store state in world
world.insert;
// Register keybindings
world..bind;
// Check focus
if world..is_focused
// Handle key events
Key.handle;
Mouse Handling
// Register click handlers
world..on_click;
// Register widget area in render function
world..set;
// Handle mouse events
Mouse.handle;
See examples/todo and examples/help.rs for complete examples.
License
MIT