Module keymap

Module keymap 

Source
Expand description

Keyboard → action mapping for the OneDrop GUI.

The GUI’s handle_keyboard dispatches every key event through Keymap::lookup. Defaults match the MD2 keybind table (see objectives_to_reach.md §7); the user can override any binding by editing [keymap.bindings] in ~/.config/onedrop/settings.toml — the override is applied at startup via Keymap::from_settings.

Structs§

Binding
A single key chord — a physical key plus the modifier flags that must be held while it’s pressed.
Keymap
Mutable, runtime keybind table. Built from the GUI’s MD2-style defaults plus optional user overrides from crate::settings::KeymapSettings.
Modifiers
Modifier-state bits we care about for dispatch. Stored as a small bitset so Binding stays trivially Copy/Hash.

Enums§

Action
Every action the GUI can dispatch from a keybind. Adding an action here requires (a) a default binding in Keymap::default and (b) a match arm in App::dispatch_action. The string form returned by Action::as_str is the stable key used in settings.toml.

Functions§

digit_to_keycode 🔒
letter_to_keycode 🔒
parse_chord 🔒
Parse a human-readable chord like "Ctrl+Shift+K" or "F5" into a Binding. Modifier names are case-insensitive (ctrl, Ctrl, CTRL); the key name uses winit’s KeyCode Debug spelling minus the Key prefix for letters (KKeyK).
parse_keycode 🔒