A practical guide to handling keybindings in Rust TUI applications using crossterm and crokey. Covers three main areas: discovering which key combinations actually work across platforms using the print_key utility, implementing hardcoded keybindings in an event loop with the key! macro, and loading configurable keybindings from a TOML file using serde deserialization into a HashMap. Includes working code examples for both simple and configurable approaches.
Table of contents
Determine what key combinations are really availableA basic event loop with hardcoded keybindingsRead keybindings from a configuration fileGo FurtherSort: