Skip to main content

Module keys

Module keys 

Source
Expand description

The key registry: every key of every screen, in one table.

Each Key is what is typed, a short label (for hints), a one-line description (the in-app help), an optional longer description (the manpage and the docs), and the key the help’s Enter presses for it. Keys sit in task Groups on a Screen; GLOBAL holds the keys every screen takes.

What shows keys reads them from here: the help overlay ? opens in datui-lib, docs/reference/keyboard-shortcuts.md (render_markdown) and datui-keys(7). A key added to the app is an entry here; a test in datui-lib presses each entry’s key in its screen and fails when nothing takes it.

Structs§

Chord
A key as the app receives it, without the terminal library: datui-lib turns it into a key event.
Group
Keys that do one kind of task: Explore, Shape, Analyze, Output, or a screen’s own (Fields, Picker).
Key
One key, or a few that do one thing in turn (n / N).
Screen
One screen’s keys.

Enums§

Code
Context
Where the keys are typed: one in-app help screen each.
Run
What Enter on a key’s help line presses, in the screen help was opened from.

Constants§

GLOBAL
The keys every screen takes. Every screen’s help lists them last.
HELP
The keys of the help overlay itself, for its footer and the reference.
QUESTION
The keys of a question datui asks before acting: overwrite a file, delete a view, read a whole dataset.
Q_SUMMARY
The q language in a few lines, for the query screen’s help and datui-query(7): an example and what it shows.
REFERENCE_URL
Where the whole reference is, the help’s last line.
SCREENS
Every screen, as the reference lists them.

Functions§

chord
Read one key: j, G, Enter, Ctrl+O, Shift+Tab, F1, ↑. None for text that is not one key.
chords
Every key a keys text names, in order: ↑ / ↓ (j/k) is ↑, ↓, j and k. Text that is not a key ((type), Click) names none.
entries
Every key entry with its screen and group, in reference order; GLOBAL, HELP and QUESTION first.
first_key
The first key a keys text names: ↑ of ↑ / ↓ (j/k), Ctrl+D of Ctrl+D/Ctrl+U.
k
A key entry: keys, a hint label and the help’s line.
lookup
The entry for keys on context’s screen, or in group of it when named: what the footer’s hints read their labels from.
render_markdown
The keyboard reference: the keys every screen takes, then each screen’s.
screen
The screen for context.