296 explicit scope_changer(hk_scopes new_scopes,
bool restore =
true);
336 std::function<void()> cleanup_{};
bool is_scope_active(scope s)
scope
Available hotkey scopes.
const std::map< HOTKEY_CATEGORY, std::string > & get_category_names()
Returns the map of hotkey categories and their display names.
static const hotkey_command & null_command()
returns the command that is treated as null
Stores all information related to functions that can be bound to hotkeys.
HOTKEY_COMMAND command
The command associated with this hotkey.
std::string id
The unique ID.
bool null() const
checks weather this is the null hotkey_command
Keyboard shortcuts for game actions.
constexpr uint32_t scope_main
RAII helper class to control the lifetime of a WML hotkey_command.
constexpr uint32_t scope_editor
const std::map< std::string_view, hotkey::hotkey_command > & get_hotkey_commands()
returns a container that contains all currently active hotkey_commands.
std::bitset< SCOPE_COUNT > hk_scopes
void init_hotkey_commands()
constexpr uint32_t scope_game
hk_scopes scope
The visibility scope of the command.
bool toggle
Toggle hotkeys have some restrictions on what can be bound to them.
static map_location::DIRECTION s
hk_scopes prev_scope_active_
bool has_hotkey_command(const std::string &id)
hotkey_command & operator=(const hotkey_command &)=default
bool hidden
If hidden then don't show the command in the hotkey preferences.
A config object defines a single node in a WML file, with access to child nodes.
const hotkey_command & get_hotkey_command(const std::string &command)
returns the hotkey_command with the given name
HOTKEY_CATEGORY category
The category of the command.
static const hotkey_command & get_command_by_command(HOTKEY_COMMAND command)
the execute_command argument was changed from HOTKEY_COMMAND to hotkey_command, to be able to call it...