Expand description
Key binding component for managing keybindings, ported from the Go version.
This module provides types and functions for defining keybindings that can be used for both input handling and generating help views. It offers a type-safe alternative to string-based key matching.
Structs§
- Binding
- Describes a set of keybindings and their associated help text. A
Bindingrepresents a single semantic action that can be triggered by one or more physical key presses. - Help
- Help information for displaying keybinding documentation.
- KeyPress
- Represents a specific key press, combining a
KeyCodeandKeyModifiers.
Traits§
- KeyMap
- KeyMap trait for components that provide help information.
Functions§
- matches
- Checks if the given KeyMsg matches any of the given bindings.
- matches_
binding - Checks if a KeyMsg matches a specific binding - Go compatibility.
- new_
binding - Creates a new binding from options - Go compatibility function.
- parse_
key_ string - Parses string representations of keys into KeyPress instances.
- with_
disabled - Creates a binding option that disables the binding.
- with_
help - Creates a binding option that sets the help text.
- with_
keys - Creates a binding option that sets the keys from KeyPress values.
- with_
keys_ str - Creates a binding option that sets the keys from string names.
Type Aliases§
- Binding
Opt - Option type for configuring a Binding during initialization.