Expand description
The engine’s reserved ui context: the navigation actions every UI screen
is driven by, as the reserved ui_* table in docs/notes/tooling.md
(What the deleted 07-ui-debug plan left behind) defines them.
| Action | Kind | Keyboard | Gamepad | Repeat |
|---|---|---|---|---|
MOVE | Axis2 | the arrows, and W, A, S and D | the left stick, and the d-pad | Repeat::UI |
NEXT | Button | Tab | the right shoulder | Repeat::UI |
PREV | Button | Shift+Tab | the left shoulder | Repeat::UI |
ACCEPT | Button | Enter, Space | PadButton::South | none |
BACK | Button | Escape | PadButton::East | none |
MENU | Button | the menu key, Shift+F10 | none | none |
Rebindable like every action — they are ordinary actions in an ordinary
context, so ActionMap::rebind moves them.
Pushed only while a UI has input. Declaring the context leaves it off
the stack; whoever owns a UI’s input pushes CONTEXT while that UI has
it and pops it after, and while it is pushed the arrows, WASD, Tab, Enter,
Space and Escape — and the pad’s left stick, d-pad, shoulders, South and
East — are the UI’s and not the game’s beneath: the context stack is the
disambiguator, not a list of special cases.
The stick reads through STICK_DEADZONE, so a stick resting off
centre does not walk a list. The d-pad is a Binding::PadDpad, the
pad’s Binding::Wasd, so it shares one unit disc with the stick and the
keys.
Start is not in the table. Like Escape’s pause, it is the engine loop’s, and the loop binds it outside this context.
MENU has no pad binding. It opens a context menu, which a pad
reaches through no convention every platform shares; and a pad button
bound here is one a pushed context takes from the game beneath.
Constants§
- ACCEPT
- Fire a button, engage a widget, or commit the engaged one.
- ACTIONS
- Every reserved action, in the table’s order.
- BACK
- Cancel the engaged widget, or close the screen.
- CONTEXT
- The reserved context’s name.
- MENU
- Open the focused widget’s context menu: the keyboard’s menu key, and Shift+F10 for a keyboard without one — Windows’ pair.
- MOVE
- Spatial focus movement: an
Axis2, +Y up. - NEXT
- Forward in tree order.
- PREV
- Backward in tree order.
- STICK_
DEADZONE - The dead zone
MOVE’s left stick reads through: the pad’s own activity threshold, so the stick navigates exactly when it would also make the pad the last device.
Functions§
- declare
- Declare the reserved
uicontext intomap, off the stack, withRepeat::UIon the three navigation actions.