ASW Lib
A.D.S. Games SDL Wrapper Library. A library targeted at Allegro4 users who want to switch to SDL3 and use modern c++.
Loading...
Searching...
No Matches
asw::ui::Navigation Struct Reference

Action names the UI reads for focus navigation, see asw/modules/action.h. More...

#include <navigation.h>

Public Attributes

std::string up
 Move focus up.
 
std::string down
 Move focus down.
 
std::string left
 Move focus left.
 
std::string right
 Move focus right.
 
std::string next
 Move focus to the next widget. Holding Shift makes it go back, so Shift+Tab still works when Tab is bound here.
 
std::string prev
 Move focus to the previous widget.
 
std::string activate
 Press the focused widget.
 
std::string back
 Go back, sent to the focused widget and then Root::on_back.
 

Detailed Description

Action names the UI reads for focus navigation, see asw/modules/action.h.

An empty name uses the built in keys for that step: arrows, Tab and Shift+Tab, Return or Space, and Escape. Set a name to read that action instead, so the UI follows the game's own bindings, controllers included.

Example:

// Default keyboard and controller bindings
ui.ctx.navigation = asw::ui::bind_default_navigation();
// Or the game's own actions
ui.ctx.navigation.up = "move_up";
ui.ctx.navigation.activate = "jump";
Navigation bind_default_navigation(std::string_view prefix="ui_")
Bind keyboard and controller actions for UI navigation and return their names. Calling it again repla...

Definition at line 33 of file navigation.h.

Member Data Documentation

◆ activate

std::string asw::ui::Navigation::activate

Press the focused widget.

Definition at line 54 of file navigation.h.

◆ back

std::string asw::ui::Navigation::back

Go back, sent to the focused widget and then Root::on_back.

Definition at line 57 of file navigation.h.

◆ down

std::string asw::ui::Navigation::down

Move focus down.

Definition at line 38 of file navigation.h.

◆ left

std::string asw::ui::Navigation::left

Move focus left.

Definition at line 41 of file navigation.h.

◆ next

std::string asw::ui::Navigation::next

Move focus to the next widget. Holding Shift makes it go back, so Shift+Tab still works when Tab is bound here.

Definition at line 48 of file navigation.h.

◆ prev

std::string asw::ui::Navigation::prev

Move focus to the previous widget.

Definition at line 51 of file navigation.h.

◆ right

std::string asw::ui::Navigation::right

Move focus right.

Definition at line 44 of file navigation.h.

◆ up

std::string asw::ui::Navigation::up

Move focus up.

Definition at line 35 of file navigation.h.


The documentation for this struct was generated from the following file: