Public Types | Public Member Functions | Data Fields | Private Member Functions | Private Attributes

# HotkeyList Struct Reference

List of hotkeys for a window. More...

`#include <hotkeys.h>`

## Public Types
typedef EventState(* | GlobalHotkeyHandlerFunc )(int hotkey)
## Public Member Functions
| HotkeyList (const char *ini_group, Hotkey *items, GlobalHotkeyHandlerFunc global_hotkey_handler=NULL)
void | Load (IniFile *ini)
| Load HotkeyList from IniFile.
void | Save (IniFile *ini) const
| Save HotkeyList to IniFile.
int | CheckMatch (uint16 keycode, bool global_only=false) const
| Check if a keycode is bound to something.
## Data Fields
GlobalHotkeyHandlerFunc | global_hotkey_handler
## Private Member Functions
| HotkeyList (const HotkeyList &other)
| Dummy private copy constructor to prevent compilers from copying the structure, which fails due to _hotkey_lists.
## Private Attributes
const char * | ini_group
Hotkey * | items

## Detailed Description

List of hotkeys for a window.

Definition at line 42 of file hotkeys.h.

## Member Function Documentation

int HotkeyList::CheckMatch | ( | uint16 | keycode,
|  | bool | global_only = `false` |
| ) |  |  | const

Check if a keycode is bound to something.

Parameters:

  | keycode | The keycode that was pressed
  | global_only | Limit the search to hotkeys defined as 'global'.

Returns:
  The number of the matching hotkey or -1.

Definition at line 298 of file hotkeys.cpp.

References WKC_GLOBAL_HOTKEY.

Referenced by HandleKeypress(), and IsQuitKey().

void HotkeyList::Load | ( | IniFile * | ini | ) |

Load HotkeyList from IniFile.

Parameters:

  | ini | IniFile to load from.

Definition at line 267 of file hotkeys.cpp.

References IniLoadFile::GetGroup(), IniGroup::GetItem(), ParseHotkeys(), and IniItem::value.

void HotkeyList::Save | ( | IniFile * | ini | ) | const

Save HotkeyList to IniFile.

Parameters:

  | ini | IniFile to save to.

Definition at line 283 of file hotkeys.cpp.

References IniLoadFile::GetGroup(), IniGroup::GetItem(), SaveKeycodes(), and IniItem::SetValue().

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

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