OpenTTD

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- Data Structures
- Class Hierarchy
- Data Fields

Public Member Functions | Data Fields
Hotkey Struct Reference

All data for a single hotkey. More...

`#include <hotkeys.h>`

## Public Member Functions
| Hotkey (uint16 default_keycode, const char *name, int num)
| Create a new Hotkey object with a single default keycode.
| Hotkey (const uint16 *default_keycodes, const char *name, int num)
| Create a new Hotkey object with multiple default keycodes.
void | AddKeycode (uint16 keycode)
| Add a keycode to this hotkey, from now that keycode will be matched in addition to any previously added keycodes.

## Data Fields
const char * | name
int | num
SmallVector< uint16, 1 > | keycodes

## Detailed Description

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.

Definition at line 24 of file hotkeys.h.

## Constructor & Destructor Documentation

Hotkey::Hotkey | ( | uint16 | default_keycode,
|  | const char * | name,
|  | int | num
| ) |  |

Create a new Hotkey object with a single default keycode.

Parameters

  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 219 of file hotkeys.cpp.

References AddKeycode().

Hotkey::Hotkey | ( | const uint16 * | default_keycodes,
|  | const char * | name,
|  | int | num
| ) |  |

Create a new Hotkey object with multiple default keycodes.

Parameters

  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 232 of file hotkeys.cpp.

References AddKeycode().

## Member Function Documentation

void Hotkey::AddKeycode | ( | uint16 | keycode | ) |

Add a keycode to this hotkey, from now that keycode will be matched in addition to any previously added keycodes.

Parameters

  keycode | The keycode to add.

Definition at line 248 of file hotkeys.cpp.

References SmallVector< T, S >::Include().

Referenced by Hotkey(), and ParseHotkeys().

The documentation for this struct was generated from the following files:

- src/hotkeys.h
- src/hotkeys.cpp