Pyrogenesis  13997
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions | Variables
Hotkey.h File Reference

Hotkey system. More...

#include "CStr.h"
#include "lib/input.h"
#include "lib/external_libraries/libsdl.h"

Go to the source code of this file.

Functions

void LoadHotkeys ()
 
InReaction HotkeyInputHandler (const SDL_Event_ *ev)
 
bool HotkeyIsPressed (const CStr &keyname)
 

Variables

const int SDL_HOTKEYDOWN = SDL_USEREVENT
 
const int SDL_HOTKEYUP = SDL_USEREVENT + 1
 

Detailed Description

Hotkey system.

Hotkeys consist of a name (an arbitrary string), and a key mapping. The names and mappings are loaded from the config system (any config setting with the name prefix "hotkey."). When a hotkey is pressed or released, SDL_HOTKEYDOWN and SDL_HOTKEYUP events are triggered, with the hotkey name stored in ev.user.data1 as a const char*.

Definition in file Hotkey.h.

Function Documentation

InReaction HotkeyInputHandler ( const SDL_Event_ ev)

Definition at line 175 of file Hotkey.cpp.

bool HotkeyIsPressed ( const CStr &  keyname)

Definition at line 400 of file Hotkey.cpp.

void LoadHotkeys ( )

Definition at line 145 of file Hotkey.cpp.

Variable Documentation

const int SDL_HOTKEYDOWN = SDL_USEREVENT

Definition at line 41 of file Hotkey.h.

const int SDL_HOTKEYUP = SDL_USEREVENT + 1

Definition at line 42 of file Hotkey.h.