OpenTTD Source
1.11.0-beta2
|
Go to the documentation of this file.
23 Hotkey(uint16 default_keycode,
const char *name,
int num);
24 Hotkey(
const uint16 *default_keycodes,
const char *name,
int num);
30 std::vector<uint16> keycodes;
33 #define HOTKEY_LIST_END Hotkey((uint16)0, nullptr, -1)
41 typedef EventState (*GlobalHotkeyHandlerFunc)(
int hotkey);
43 HotkeyList(
const char *ini_group,
Hotkey *items, GlobalHotkeyHandlerFunc global_hotkey_handler =
nullptr);
49 int CheckMatch(uint16 keycode,
bool global_only =
false)
const;
51 GlobalHotkeyHandlerFunc global_hotkey_handler;
53 const char *ini_group;
69 void HandleGlobalHotkeys(
WChar key, uint16 keycode);
char32_t WChar
Type for wide characters, i.e.
List of hotkeys for a window.
void AddKeycode(uint16 keycode)
Add a keycode to this hotkey, from now that keycode will be matched in addition to any previously add...
void Save(IniFile *ini) const
Save HotkeyList to IniFile.
void Load(IniFile *ini)
Load HotkeyList from IniFile.
Ini file that supports both loading and saving.
bool IsQuitKey(uint16 keycode)
Does the given keycode match one of the keycodes bound to 'quit game'?
EventState
State of handling an event.
void LoadHotkeysFromConfig()
Load the hotkeys from the config file.
Hotkey(uint16 default_keycode, const char *name, int num)
Create a new Hotkey object with a single default keycode.
int CheckMatch(uint16 keycode, bool global_only=false) const
Check if a keycode is bound to something.
All data for a single hotkey.
void SaveHotkeysToConfig()
Save the hotkeys to the config file.