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
lib
input.h
Go to the documentation of this file.
1
/* Copyright (c) 2012 Wildfire Games
2
*
3
* Permission is hereby granted, free of charge, to any person obtaining
4
* a copy of this software and associated documentation files (the
5
* "Software"), to deal in the Software without restriction, including
6
* without limitation the rights to use, copy, modify, merge, publish,
7
* distribute, sublicense, and/or sell copies of the Software, and to
8
* permit persons to whom the Software is furnished to do so, subject to
9
* the following conditions:
10
*
11
* The above copyright notice and this permission notice shall be included
12
* in all copies or substantial portions of the Software.
13
*
14
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
*/
22
23
/*
24
* SDL input redirector; dispatches to multiple handlers.
25
*/
26
27
#ifndef INCLUDED_INPUT
28
#define INCLUDED_INPUT
29
30
31
#include "
lib/external_libraries/libsdl_fwd.h
"
32
33
// input handler return values.
34
enum
InReaction
35
{
36
// (the handlers' return values are checked and these
37
// 'strange' values might bring errors to light)
38
39
// pass the event to the next handler in the chain
40
IN_PASS
= 4,
41
42
// we've handled it; no other handlers will receive this event.
43
IN_HANDLED
= 2
44
};
45
46
typedef
InReaction
(*
InHandler
)(
const
SDL_Event_
*);
47
48
// register an input handler, which will receive all subsequent events first.
49
// events are passed to other handlers if handler returns IN_PASS.
50
extern
void
in_add_handler
(
InHandler
handler
);
51
52
// remove all registered input handlers
53
extern
void
in_reset_handlers
();
54
55
// send event to each handler (newest first) until one returns true
56
extern
void
in_dispatch_event
(
const
SDL_Event_
* event);
57
58
#endif // #ifndef INCLUDED_INPUT
in_dispatch_event
void in_dispatch_event(const SDL_Event_ *ev)
Definition:
input.cpp:55
InHandler
InReaction(* InHandler)(const SDL_Event_ *)
Definition:
input.h:46
in_add_handler
void in_add_handler(InHandler handler)
Definition:
input.cpp:39
vm::handler
static PVOID handler
Definition:
wvm.cpp:515
SDL_Event_
Definition:
libsdl.h:54
IN_HANDLED
Definition:
input.h:43
in_reset_handlers
void in_reset_handlers()
Definition:
input.cpp:49
InReaction
InReaction
Definition:
input.h:34
IN_PASS
Definition:
input.h:40
libsdl_fwd.h
Generated on Mon Oct 14 2013 00:58:07 for Pyrogenesis by
1.8.5