|
OpenTTD
|
Implementation of hotkey related functions. More...
#include "stdafx.h"#include "openttd.h"#include "hotkeys.h"#include "ini_type.h"#include "string_func.h"#include "window_gui.h"#include "safeguards.h"Go to the source code of this file.
Data Structures | |
| struct | KeycodeNames |
| String representation of a keycode. More... | |
Functions | |
| static uint16 | ParseCode (const char *start, const char *end) |
| Try to parse a single part of a keycode. | |
| static uint16 | ParseKeycode (const char *start, const char *end) |
| Parse a string representation of a keycode. | |
| static void | ParseHotkeys (Hotkey *hotkey, const char *value) |
| Parse a string to the keycodes it represents. | |
| static const char * | KeycodeToString (uint16 keycode) |
| Convert a hotkey to it's string representation so it can be written to the config file. | |
| const char * | SaveKeycodes (const Hotkey *hotkey) |
| Convert all keycodes attached to a hotkey to a single string. | |
| static void | SaveLoadHotkeys (bool save) |
| void | LoadHotkeysFromConfig () |
| Load the hotkeys from the config file. | |
| void | SaveHotkeysToConfig () |
| Save the hotkeys to the config file. | |
| void | HandleGlobalHotkeys (WChar key, uint16 keycode) |
Variables | |
| char * | _hotkeys_file |
| static SmallVector< HotkeyList *, 16 > * | _hotkey_lists = NULL |
| List of all HotkeyLists. | |
| static const KeycodeNames | _keycode_to_name [] |
| Array of non-standard keycodes that can be used in the hotkeys config file. | |
Implementation of hotkey related functions.
Definition in file hotkeys.cpp.
|
static |
Convert a hotkey to it's string representation so it can be written to the config file.
Separate parts of the keycode (like "CTRL" and "F1" are split by a '+'.
| keycode | The keycode to convert to a string. |
Definition at line 147 of file hotkeys.cpp.
References lastof, lengthof, strecat(), and WKC_GLOBAL_HOTKEY.
Referenced by SaveKeycodes().
|
static |
Try to parse a single part of a keycode.
| start | Start of the string to parse. |
| end | End of the string to parse. |
Definition at line 72 of file hotkeys.cpp.
References KeycodeNames::keycode, and lengthof.
Referenced by ParseKeycode().
|
static |
Parse a string to the keycodes it represents.
| hotkey | The hotkey object to add the keycodes to |
| value | The string to parse |
Definition at line 126 of file hotkeys.cpp.
References Hotkey::AddKeycode(), and ParseKeycode().
Referenced by HotkeyList::Load().
|
static |
Parse a string representation of a keycode.
| start | Start of the input. |
| end | End of the input. |
Definition at line 96 of file hotkeys.cpp.
References ParseCode().
Referenced by ParseHotkeys().
| const char* SaveKeycodes | ( | const Hotkey * | hotkey | ) |
Convert all keycodes attached to a hotkey to a single string.
If multiple keycodes are attached to the hotkey they are split by a comma.
| hotkey | The keycodes of this hotkey need to be converted to a string. |
Definition at line 201 of file hotkeys.cpp.
References KeycodeToString(), lastof, SmallVector< T, S >::Length(), and strecat().
Referenced by HotkeyList::Save().
|
static |
List of all HotkeyLists.
This is a pointer to ensure initialisation order with the various static HotkeyList instances.
Definition at line 27 of file hotkeys.cpp.
|
static |
Array of non-standard keycodes that can be used in the hotkeys config file.
Definition at line 36 of file hotkeys.cpp.
1.8.1.2