Expand description
Help text that names keys and controller buttons. Names always come
from the active Keymap, never string literals, because each layout
binds actions to different keys (game ADR-0015) and the player can rebind
them (game ADR-0031); and they follow the Device the player pressed last
(docs/design/controls.md, Controller): keys on the keyboard, the
pad’s own button names on a controller.
Generic over the game’s ActionSet (ticket 1106).
Structs§
- Help
Keys - What help text names keys from: the bindings, the device whose keys
or buttons to name, the two words a key’s name can be
(
! not mapped,arrows) and what joins a button chord’s two buttons (A+B). A game gives its screens one with the words in the player’s language (worded). Dereferences to theKeymap.
Constants§
- ARROWS
- The English name of the four arrow keys together: what
HelpKeys::newstarts with, and what tests compare with. The game shows the language file’s word. Lives here because it names keys (onlyinputmay). - CHORD_
JOIN - The English of what joins a button chord’s two buttons (
A+B): whatHelpKeys::newstarts with, and what tests compare with. The game shows the language file’s. - NOT_
MAPPED - The English of
HelpKeys::not_mapped: whatHelpKeys::newstarts with, and what tests compare with. The game showskeys.not_mappedof the language file. - SEPARATOR
- Separator between the parts of a help line.
Functions§
- all_
key_ names - Every key for
action, joined with/(e.g.f/j/Enter/Space): its slots inKeymap::chords_fororder, then its fixed keys (Keymap::fixed_chords_for). On a controller, every button for it (Keymap::buttons_for).HelpKeys::not_mappedif its slots are empty. - cursor_
keys_ name - What moves the cursor:
arrowswhen the four cursor actions are on the arrow keys, otherwise their keys in up-left-down-right order (wasd). On a controller,D-pad/L-stickor whatever the cursor is on (Keymap::cursor_buttons_name).HelpKeys::not_mappedif any cursor action has no key. SeeKeymap::cursor_keys_name. - help_
line - Joins
key labelhints withSEPARATOR, leaving out hints whose key isNone(hidden by the caller, e.g. a key that does nothing here). - key_
name - The name of the key for
action(itsKeymap::primarychord), e.g.forShift+Space; on a controller, of its button or button chord (Keymap::primary_button) as that pad labels it, e.g.AorA+B.HelpKeys::not_mappedif it has none.