Pyrogenesis
13997
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
source
ps
Hotkey.h
Go to the documentation of this file.
1
/* Copyright (C) 2012 Wildfire Games.
2
* This file is part of 0 A.D.
3
*
4
* 0 A.D. is free software: you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation, either version 2 of the License, or
7
* (at your option) any later version.
8
*
9
* 0 A.D. is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
16
*/
17
18
#ifndef INCLUDED_HOTKEY
19
#define INCLUDED_HOTKEY
20
21
/**
22
* @file
23
* Hotkey system.
24
*
25
* Hotkeys consist of a name (an arbitrary string), and a key mapping.
26
* The names and mappings are loaded from the config system (any
27
* config setting with the name prefix "hotkey.").
28
* When a hotkey is pressed or released, SDL_HOTKEYDOWN and SDL_HOTKEYUP
29
* events are triggered, with the hotkey name stored in ev.user.data1
30
* as a const char*.
31
*/
32
33
#include "
CStr.h
"
34
#include "
lib/input.h
"
35
#include "
lib/external_libraries/libsdl.h
"
// see note below
36
37
// note: we need the real SDL header - it defines SDL_USEREVENT, which is
38
// required for our HOTKEY event type definition. this is OK since
39
// hotkey.h is not included from any headers.
40
41
const
int
SDL_HOTKEYDOWN
=
SDL_USEREVENT
;
42
const
int
SDL_HOTKEYUP
=
SDL_USEREVENT
+ 1;
43
44
extern
void
LoadHotkeys
();
45
extern
InReaction
HotkeyInputHandler
(
const
SDL_Event_
* ev);
46
47
extern
bool
HotkeyIsPressed
(
const
CStr& keyname);
48
49
#endif // INCLUDED_HOTKEY
libsdl.h
input.h
CStr.h
SDL_Event_
Definition:
libsdl.h:54
SDL_HOTKEYUP
const int SDL_HOTKEYUP
Definition:
Hotkey.h:42
InReaction
InReaction
Definition:
input.h:34
LoadHotkeys
void LoadHotkeys()
Definition:
Hotkey.cpp:145
SDL_HOTKEYDOWN
const int SDL_HOTKEYDOWN
Definition:
Hotkey.h:41
HotkeyInputHandler
InReaction HotkeyInputHandler(const SDL_Event_ *ev)
Definition:
Hotkey.cpp:175
SDL_USEREVENT
Definition:
wsdl.h:297
HotkeyIsPressed
bool HotkeyIsPressed(const CStr &keyname)
Definition:
Hotkey.cpp:400
Generated on Mon Oct 14 2013 00:58:08 for Pyrogenesis by
1.8.5