OpenTTD Source 20241224-master-gf74b0cf984
hotkeys.h File Reference

Hotkey related functions. More...

#include "gfx_type.h"
#include "window_type.h"
#include "string_type.h"

Go to the source code of this file.

Data Structures

struct  Hotkey
 All data for a single hotkey. More...
 
struct  HotkeyList
 List of hotkeys for a window. More...
 

Functions

bool IsQuitKey (uint16_t keycode)
 Does the given keycode match one of the keycodes bound to 'quit game'?
 
void LoadHotkeysFromConfig ()
 Load the hotkeys from the config file.
 
void SaveHotkeysToConfig ()
 Save the hotkeys to the config file.
 
void HandleGlobalHotkeys (char32_t key, uint16_t keycode)
 

Detailed Description

Hotkey related functions.

Definition in file hotkeys.h.

Function Documentation

◆ HandleGlobalHotkeys()

void HandleGlobalHotkeys ( char32_t  key,
uint16_t  keycode 
)

Definition at line 351 of file hotkeys.cpp.

◆ IsQuitKey()

bool IsQuitKey ( uint16_t  keycode)

Does the given keycode match one of the keycodes bound to 'quit game'?

Parameters
keycodeThe keycode that was pressed by the user.
Returns
True iff the keycode matches one of the hotkeys for 'quit'.

Definition at line 534 of file main_gui.cpp.

References HotkeyList::CheckMatch().

Referenced by EndGameHighScoreBaseWindow::OnKeyPress().

◆ LoadHotkeysFromConfig()

void LoadHotkeysFromConfig ( )

Load the hotkeys from the config file.

Definition at line 340 of file hotkeys.cpp.

Referenced by AfterNewGRFScan::OnNewGRFsScanned().

◆ SaveHotkeysToConfig()

void SaveHotkeysToConfig ( )

Save the hotkeys to the config file.

Definition at line 346 of file hotkeys.cpp.