Event.h
Go to the documentation of this file.
1 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24 
25 #ifndef SFML_EVENT_H
26 #define SFML_EVENT_H
27 
29 // Headers
31 #include <SFML/Window/Export.h>
32 #include <SFML/Window/Joystick.h>
33 #include <SFML/Window/Keyboard.h>
34 #include <SFML/Window/Mouse.h>
35 #include <SFML/Window/Sensor.h>
36 
37 
42 typedef enum
43 {
67 
69 } sfEventType;
70 
71 
76 typedef struct
77 {
84 } sfKeyEvent;
85 
90 typedef struct
91 {
94 } sfTextEvent;
95 
100 typedef struct
101 {
103  int x;
104  int y;
106 
111 typedef struct
112 {
115  int x;
116  int y;
118 
123 typedef struct
124 {
126  int delta;
127  int x;
128  int y;
130 
135 typedef struct
136 {
139  float delta;
140  int x;
141  int y;
143 
148 typedef struct
149 {
151  unsigned int joystickId;
153  float position;
155 
160 typedef struct
161 {
163  unsigned int joystickId;
164  unsigned int button;
166 
171 typedef struct
172 {
174  unsigned int joystickId;
176 
181 typedef struct
182 {
184  unsigned int width;
185  unsigned int height;
186 } sfSizeEvent;
187 
192 typedef struct
193 {
195  unsigned int finger;
196  int x;
197  int y;
198 } sfTouchEvent;
199 
204 typedef struct
205 {
208  float x;
209  float y;
210  float z;
211 } sfSensorEvent;
212 
217 typedef union
218 {
232 } sfEvent;
233 
234 
235 #endif // SFML_EVENT_H
sfJoystickAxis axis
Definition: Event.h:152
A key was pressed (data in event.key)
Definition: Event.h:49
sfSensorEvent sensor
Sensor event parameters.
Definition: Event.h:231
sfEventType type
Definition: Event.h:206
Text event parameters.
Definition: Event.h:90
The window gained the focus (no data)
Definition: Event.h:47
sfEventType type
Definition: Event.h:125
Keyboard event parameters.
Definition: Event.h:76
sfJoystickConnectEvent joystickConnect
Joystick (dis)connect event parameters.
Definition: Event.h:229
The window was resized (data in event.size)
Definition: Event.h:45
The joystick moved along an axis (data in event.joystickMove)
Definition: Event.h:60
sfEventType type
Definition: Event.h:113
sfEventType type
Definition: Event.h:194
sfMouseWheelEvent mouseWheel
Mouse wheel event parameters (deprecated)
Definition: Event.h:225
unsigned int finger
Definition: Event.h:195
sfUint32 unicode
Definition: Event.h:93
sfEventType type
Definition: Event.h:102
sfJoystickMoveEvent joystickMove
Joystick move event parameters.
Definition: Event.h:227
A mouse button was released (data in event.mouseButton)
Definition: Event.h:54
Mouse wheel events parameters (deprecated)
Definition: Event.h:123
unsigned int joystickId
Definition: Event.h:174
unsigned int joystickId
Definition: Event.h:163
Touch events parameters.
Definition: Event.h:192
Size events parameters.
Definition: Event.h:181
Mouse wheel events parameters.
Definition: Event.h:135
sfBool shift
Definition: Event.h:82
A mouse button was pressed (data in event.mouseButton)
Definition: Event.h:53
sfMouseWheelScrollEvent mouseWheelScroll
Mouse wheel event parameters.
Definition: Event.h:226
Joystick connection/disconnection event parameters.
Definition: Event.h:171
float x
Definition: Event.h:208
A touch moved (data in event.touch)
Definition: Event.h:64
unsigned int joystickId
Definition: Event.h:151
Joystick buttons events parameters.
Definition: Event.h:160
float z
Definition: Event.h:210
int sfBool
Definition: Config.h:117
Mouse buttons events parameters.
Definition: Event.h:111
unsigned int button
Definition: Event.h:164
unsigned int height
Definition: Event.h:185
sfJoystickButtonEvent joystickButton
Joystick button event parameters.
Definition: Event.h:228
sfEventType type
Definition: Event.h:78
sfEvent defines a system event and its parameters
Definition: Event.h:217
float y
Definition: Event.h:209
A touch event ended (data in event.touch)
Definition: Event.h:65
sfBool alt
Definition: Event.h:80
sfEventType type
Definition: Event.h:173
The mouse cursor left the area of the window (no data)
Definition: Event.h:57
sfKeyCode code
Definition: Event.h:79
Sensor event parameters.
Definition: Event.h:204
sfSizeEvent size
Size event parameters.
Definition: Event.h:220
sfJoystickAxis
Axes supported by SFML joysticks.
Definition: Joystick.h:51
The mouse wheel was scrolled (data in event.mouseWheelScroll)
Definition: Event.h:52
Joystick axis move event parameters.
Definition: Event.h:148
A character was entered (data in event.text)
Definition: Event.h:48
sfKeyEvent key
Key event parameters.
Definition: Event.h:221
sfEventType type
Definition: Event.h:92
unsigned int sfUint32
Definition: Config.h:140
sfEventType type
Type of the event.
Definition: Event.h:219
sfTouchEvent touch
Touch events parameters.
Definition: Event.h:230
The window lost the focus (no data)
Definition: Event.h:46
The mouse wheel was scrolled (data in event.mouseWheel) (deprecated)
Definition: Event.h:51
A joystick was connected (data in event.joystickConnect)
Definition: Event.h:61
sfEventType type
Definition: Event.h:150
sfSensorType
Sensor Types.
Definition: Sensor.h:40
sfMouseWheel wheel
Definition: Event.h:138
A touch event began (data in event.touch)
Definition: Event.h:63
sfMouseButton button
Definition: Event.h:114
A joystick button was released (data in event.joystickButton)
Definition: Event.h:59
The mouse cursor entered the area of the window (no data)
Definition: Event.h:56
sfMouseMoveEvent mouseMove
Mouse move event parameters.
Definition: Event.h:223
A key was released (data in event.key)
Definition: Event.h:50
A joystick was disconnected (data in event.joystickConnect)
Definition: Event.h:62
sfEventType type
Definition: Event.h:137
sfSensorType sensorType
Definition: Event.h:207
The mouse cursor moved (data in event.mouseMove)
Definition: Event.h:55
The window requested to be closed (no data)
Definition: Event.h:44
sfMouseButtonEvent mouseButton
Mouse button event parameters.
Definition: Event.h:224
sfMouseWheel
Mouse wheels.
Definition: Mouse.h:55
sfEventType
Definition of all the event types.
Definition: Event.h:42
sfTextEvent text
Text event parameters.
Definition: Event.h:222
sfMouseButton
Mouse buttons.
Definition: Mouse.h:40
A sensor value changed (data in event.sensor)
Definition: Event.h:66
unsigned int width
Definition: Event.h:184
A joystick button was pressed (data in event.joystickButton)
Definition: Event.h:58
sfEventType type
Definition: Event.h:183
Keep last – the total number of event types.
Definition: Event.h:68
sfEventType type
Definition: Event.h:162
Mouse move event parameters.
Definition: Event.h:100
sfBool system
Definition: Event.h:83
sfBool control
Definition: Event.h:81
sfKeyCode
Key codes.
Definition: Keyboard.h:38