Pyrogenesis  trunk
Functions | Variables
Hotkey.h File Reference

Hotkey system. More...

#include "CStr.h"
#include "lib/input.h"
#include "lib/external_libraries/libsdl.h"
Include dependency graph for Hotkey.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void LoadHotkeys ()
 
void UnloadHotkeys ()
 
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*.

Function Documentation

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

Variable Documentation

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