Module key

Module key 

Source
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 Binding represents 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 KeyCode and KeyModifiers.

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§

BindingOpt
Option type for configuring a Binding during initialization.