22 Hotkey(uint16_t default_keycode,
const std::string &name,
int num);
23 Hotkey(
const std::vector<uint16_t> &default_keycodes,
const std::string &name,
int num);
27 const std::string name;
29 std::set<uint16_t> keycodes;
38 typedef EventState (*GlobalHotkeyHandlerFunc)(
int hotkey);
40 HotkeyList(
const std::string &ini_group,
const std::vector<Hotkey> &items, GlobalHotkeyHandlerFunc global_hotkey_handler =
nullptr);
46 int CheckMatch(uint16_t keycode,
bool global_only =
false)
const;
48 GlobalHotkeyHandlerFunc global_hotkey_handler;
50 const std::string ini_group;
51 std::vector<Hotkey> items;
66void HandleGlobalHotkeys(
char32_t key, uint16_t keycode);
Types related to the graphics and/or input devices.
void LoadHotkeysFromConfig()
Load the hotkeys from the config file.
bool IsQuitKey(uint16_t keycode)
Does the given keycode match one of the keycodes bound to 'quit game'?
void SaveHotkeysToConfig()
Save the hotkeys to the config file.
List of hotkeys for a window.
void Save(IniFile &ini) const
Save HotkeyList to IniFile.
HotkeyList(const HotkeyList &other)
Dummy private copy constructor to prevent compilers from copying the structure, which fails due to _h...
int CheckMatch(uint16_t keycode, bool global_only=false) const
Check if a keycode is bound to something.
void Load(const IniFile &ini)
Load HotkeyList from IniFile.
All data for a single hotkey.
void AddKeycode(uint16_t keycode)
Add a keycode to this hotkey, from now that keycode will be matched in addition to any previously add...
Ini file that supports both loading and saving.
Types related to windows.
EventState
State of handling an event.