Hotkey related functions. More...
#include "core/smallvec_type.hpp"
#include "gfx_type.h"
Go to the source code of this file.
Data Structures | |
struct | Hotkey< T > |
All data for a single hotkey. More... | |
struct | Hotkey< T >::CallbackWrapper |
A wrapper around the callback function. More... | |
Defines | |
#define | HOTKEY_LIST_END(window_class) Hotkey<window_class>((uint16)0, NULL, -1) |
Functions | |
template<class T > | |
int | CheckHotkeyMatch (Hotkey< T > *list, uint16 keycode, T *w, bool global_only=false) |
Check if a keycode is bound to something. | |
bool | IsQuitKey (uint16 keycode) |
Does the given keycode match one of the keycodes bound to 'quit game'? | |
void | LoadHotkeysFromConfig () |
Load the hotkeys from the config file. | |
void | SaveHotkeysToConfig () |
Save the hotkeys to the config file. | |
void | HandleGlobalHotkeys (uint16 key, uint16 keycode) |
Hotkey related functions.
Definition in file hotkeys.h.
int CheckHotkeyMatch | ( | Hotkey< T > * | list, | |
uint16 | keycode, | |||
T * | w, | |||
bool | global_only = false | |||
) | [inline] |
Check if a keycode is bound to something.
list | The list with hotkeys to check | |
keycode | The keycode that was pressed | |
w | The window-pointer to give to the callback function (if any). | |
global_only | Limit the search to hotkeys defined as 'global'. |
Definition at line 115 of file hotkeys.h.
References SmallVector< T, S >::Contains(), and WKC_GLOBAL_HOTKEY.
Referenced by ScenarioEditorToolbarWindow::OnKeyPress(), MainToolbarWindow::OnKeyPress(), ScenarioEditorLandscapeGenerationWindow::OnKeyPress(), TerraformToolbarWindow::OnKeyPress(), SignListWindow::OnKeyPress(), BuildRoadToolbarWindow::OnKeyPress(), BuildRailToolbarWindow::OnKeyPress(), MainWindow::OnKeyPress(), BuildDocksToolbarWindow::OnKeyPress(), and BuildAirToolbarWindow::OnKeyPress().
bool IsQuitKey | ( | uint16 | keycode | ) |
Does the given keycode match one of the keycodes bound to 'quit game'?
keycode | The keycode that was pressed by the user. |
Definition at line 508 of file main_gui.cpp.
Referenced by EndGameHighScoreBaseWindow::OnKeyPress().