OpenTTD Source 20241224-master-gf74b0cf984
|
All data for a single hotkey. More...
#include <hotkeys.h>
Public Member Functions | |
Hotkey (uint16_t default_keycode, const std::string &name, int num) | |
Create a new Hotkey object with a single default keycode. | |
Hotkey (const std::vector< uint16_t > &default_keycodes, const std::string &name, int num) | |
Create a new Hotkey object with multiple default keycodes. | |
void | AddKeycode (uint16_t keycode) |
Add a keycode to this hotkey, from now that keycode will be matched in addition to any previously added keycodes. | |
Data Fields | |
const std::string | name |
int | num |
std::set< uint16_t > | keycodes |
All data for a single hotkey.
The name (for saving/loading a configfile), a list of keycodes and a number to help identifying this hotkey.
Hotkey::Hotkey | ( | uint16_t | default_keycode, |
const std::string & | name, | ||
int | num | ||
) |
Create a new Hotkey object with a single default keycode.
default_keycode | The default keycode for this hotkey. |
name | The name of this hotkey. |
num | Number of this hotkey, should be unique within the hotkey list. |
Definition at line 229 of file hotkeys.cpp.
References AddKeycode().
Hotkey::Hotkey | ( | const std::vector< uint16_t > & | default_keycodes, |
const std::string & | name, | ||
int | num | ||
) |
Create a new Hotkey object with multiple default keycodes.
default_keycodes | An array of default keycodes terminated with 0. |
name | The name of this hotkey. |
num | Number of this hotkey, should be unique within the hotkey list. |
Definition at line 242 of file hotkeys.cpp.
References AddKeycode().
void Hotkey::AddKeycode | ( | uint16_t | keycode | ) |
Add a keycode to this hotkey, from now that keycode will be matched in addition to any previously added keycodes.
keycode | The keycode to add. |
Definition at line 256 of file hotkeys.cpp.
Referenced by Hotkey(), Hotkey(), and ParseHotkeys().