OpenTTD Source
20240915-master-g3784a3d3d6
|
Go to the documentation of this file.
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;
66 void HandleGlobalHotkeys(char32_t key, uint16_t keycode);
List of hotkeys for a window.
void Load(const IniFile &ini)
Load HotkeyList from IniFile.
bool IsQuitKey(uint16_t keycode)
Does the given keycode match one of the keycodes bound to 'quit game'?
Ini file that supports both loading and saving.
int CheckMatch(uint16_t keycode, bool global_only=false) const
Check if a keycode is bound to something.
Hotkey(uint16_t default_keycode, const std::string &name, int num)
Create a new Hotkey object with a single default keycode.
EventState
State of handling an event.
void LoadHotkeysFromConfig()
Load the hotkeys from the config file.
void Save(IniFile &ini) const
Save HotkeyList to IniFile.
void AddKeycode(uint16_t keycode)
Add a keycode to this hotkey, from now that keycode will be matched in addition to any previously add...
All data for a single hotkey.
void SaveHotkeysToConfig()
Save the hotkeys to the config file.