Stores all information related to functions that can be bound to hotkeys. More...
#include <hotkey_command.hpp>
Public Member Functions | |
hotkey_command ()=delete | |
hotkey_command (const hotkey_command_temp &temp_command) | |
Constructs a new command from a temporary static hotkey object. More... | |
hotkey_command (HOTKEY_COMMAND cmd, const std::string &id, const t_string &desc, bool hidden, bool toggle, hk_scopes scope, HOTKEY_CATEGORY category, const t_string &tooltip) | |
hotkey_command (const hotkey_command &)=default | |
hotkey_command & | operator= (const hotkey_command &)=default |
bool | null () const |
checks weather this is the null hotkey_command More... | |
Static Public Member Functions | |
static const hotkey_command & | null_command () |
returns the command that is treated as null More... | |
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 with HOTKEY_COMMAND, this function was created More... | |
Public Attributes | |
HOTKEY_COMMAND | command |
The command associated with this hotkey. More... | |
std::string | id |
The unique ID. More... | |
t_string | description |
bool | hidden |
If hidden then don't show the command in the hotkey preferences. More... | |
bool | toggle |
Toggle hotkeys have some restrictions on what can be bound to them. More... | |
hk_scopes | scope |
The visibility scope of the command. More... | |
HOTKEY_CATEGORY | category |
The category of the command. More... | |
t_string | tooltip |
Stores all information related to functions that can be bound to hotkeys.
this is currently a semi struct: it haves a constructor, but only const-public members.
Definition at line 246 of file hotkey_command.hpp.
|
delete |
hotkey::hotkey_command::hotkey_command | ( | const hotkey_command_temp & | temp_command | ) |
Constructs a new command from a temporary static hotkey object.
Definition at line 427 of file hotkey_command.cpp.
hotkey::hotkey_command::hotkey_command | ( | hotkey::HOTKEY_COMMAND | cmd, |
const std::string & | id, | ||
const t_string & | desc, | ||
bool | hidden, | ||
bool | toggle, | ||
hotkey::hk_scopes | scop, | ||
hotkey::HOTKEY_CATEGORY | cat, | ||
const t_string & | tooltip | ||
) |
Aggregate initialization with try_emplace?
Definition at line 439 of file hotkey_command.cpp.
|
default |
|
static |
the execute_command argument was changed from HOTKEY_COMMAND to hotkey_command, to be able to call it with HOTKEY_COMMAND, this function was created
Definition at line 480 of file hotkey_command.cpp.
References command, ERR_G, and null_command().
Referenced by hotkey::command_executor::execute_quit_command(), gui2::dialogs::mp_staging::pre_show(), gui2::styled_widget::signal_handler_show_tooltip(), play_controller::hotkey_handler::toggle_accelerated_speed(), and playsingle_controller::hotkey_handler::whiteboard_toggle().
bool hotkey::hotkey_command::null | ( | ) | const |
checks weather this is the null hotkey_command
Definition at line 463 of file hotkey_command.cpp.
References command, description, ERR_G, hotkey::HOTKEY_NULL, id, null_command(), and scope.
|
static |
returns the command that is treated as null
Definition at line 458 of file hotkey_command.cpp.
Referenced by get_command_by_command(), hotkey::get_hotkey_command(), and null().
|
default |
HOTKEY_CATEGORY hotkey::hotkey_command::category |
The category of the command.
Definition at line 281 of file hotkey_command.hpp.
HOTKEY_COMMAND hotkey::hotkey_command::command |
The command associated with this hotkey.
Does not need to be unique.
Definition at line 260 of file hotkey_command.hpp.
Referenced by hotkey::command_executor::execute_command_wrap(), get_command_by_command(), hotkey::command_executor::get_menu_images(), hotkey::has_hotkey_command(), gui2::event::sdl_event_handler::hotkey_pressed(), editor::editor_toolkit::init_mouse_actions(), null(), and hotkey::ui_command::ui_command().
t_string hotkey::hotkey_command::description |
Definition at line 266 of file hotkey_command.hpp.
Referenced by gui2::dialogs::preferences_dialog::add_hotkey_callback(), hotkey::command_executor::get_menu_images(), and null().
bool hotkey::hotkey_command::hidden |
If hidden then don't show the command in the hotkey preferences.
Definition at line 269 of file hotkey_command.hpp.
std::string hotkey::hotkey_command::id |
The unique ID.
Definition at line 263 of file hotkey_command.hpp.
Referenced by gui2::dialogs::preferences_dialog::add_hotkey_callback(), null(), and gui2::dialogs::preferences_dialog::remove_hotkey_callback().
hk_scopes hotkey::hotkey_command::scope |
The visibility scope of the command.
Definition at line 278 of file hotkey_command.hpp.
Referenced by hotkey::hotkey_base::bindings_equal(), and null().
bool hotkey::hotkey_command::toggle |
Toggle hotkeys have some restrictions on what can be bound to them.
They require a binding that has two states, "pressed" and "released"
Definition at line 275 of file hotkey_command.hpp.
Referenced by hotkey::create_hotkey(), and hotkey::hotkey_keyboard::matches_helper().
t_string hotkey::hotkey_command::tooltip |
Definition at line 283 of file hotkey_command.hpp.