Expand description
Key bindings the user edits: keybindings.toml in the app’s configuration folder, a key or a
list of keys per command, in sections ([commands] for the registry’s commands, and one per
part of an app that binds its own keys, as a plot’s [plot]). Read once at start
(load_keybindings); each section is resolved against its defaults (resolve); a
missing file is written with every default (write_default_keybindings) so the user sees
what can be changed. A key that cannot be read keeps its default and is named in a notice
(take_notices).
Functions§
- bind_
commands - Gives the registry’s commands their keys from
[commands](the first key the file names; the defaults are the commands’ own) and binds them (Registry::bind_keys). Returns what could not be bound. - load_
keybindings - Reads
keybindings.toml(a missing file: every default). Call once at start, before any section is resolved. - parse_
key - A key as the files write it, for matching by hand: (control or command, alt, shift, key).
None: not a key. - resolve
- The keys of
section’s commands: the file’s where it names the command, elsedefaults.validsays whether a key can be bound (one that cannot keeps the default). Commands the file names thatdefaultslacks, and one key on two commands, are noticed. - take_
notices - The notices collected so far (each is given once).
- write_
default_ keybindings - Writes
keybindings.tomlwith every default of the sections resolved so far, when the file does not exist yet.
Type Aliases§
- Keys
- A section’s commands with their keys.