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 {
66 
68 } sfEventType;
69 
70 
75 typedef struct
76 {
83 } sfKeyEvent;
84 
89 typedef struct
90 {
93 } sfTextEvent;
94 
99 typedef struct
100 {
102  int x;
103  int y;
105 
110 typedef struct
111 {
114  int x;
115  int y;
117 
122 typedef struct
123 {
125  int delta;
126  int x;
127  int y;
129 
134 typedef struct
135 {
137  unsigned int joystickId;
139  float position;
141 
146 typedef struct
147 {
149  unsigned int joystickId;
150  unsigned int button;
152 
157 typedef struct
158 {
160  unsigned int joystickId;
162 
167 typedef struct
168 {
170  unsigned int width;
171  unsigned int height;
172 } sfSizeEvent;
173 
178 typedef struct
179 {
181  unsigned int finger;
182  int x;
183  int y;
184 } sfTouchEvent;
185 
190 typedef struct
191 {
194  float x;
195  float y;
196  float z;
197 } sfSensorEvent;
198 
203 typedef union
204 {
217 } sfEvent;
218 
219 
220 #endif // SFML_EVENT_H
sfJoystickAxis axis
Definition: Event.h:138
A key was pressed (data in event.key)
Definition: Event.h:49
sfSensorEvent sensor
Sensor event parameters.
Definition: Event.h:216
sfEventType type
Definition: Event.h:192
Text event parameters.
Definition: Event.h:89
The window gained the focus (no data)
Definition: Event.h:47
sfEventType type
Definition: Event.h:124
Keyboard event parameters.
Definition: Event.h:75
sfJoystickConnectEvent joystickConnect
Joystick (dis)connect event parameters.
Definition: Event.h:214
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:59
sfEventType type
Definition: Event.h:112
sfEventType type
Definition: Event.h:180
sfMouseWheelEvent mouseWheel
Mouse wheel event parameters.
Definition: Event.h:211
unsigned int finger
Definition: Event.h:181
sfUint32 unicode
Definition: Event.h:92
sfEventType type
Definition: Event.h:101
sfJoystickMoveEvent joystickMove
Joystick move event parameters.
Definition: Event.h:212
A mouse button was released (data in event.mouseButton)
Definition: Event.h:53
Mouse wheel events parameters.
Definition: Event.h:122
unsigned int joystickId
Definition: Event.h:160
unsigned int joystickId
Definition: Event.h:149
Touch events parameters.
Definition: Event.h:178
Size events parameters.
Definition: Event.h:167
sfBool shift
Definition: Event.h:81
A mouse button was pressed (data in event.mouseButton)
Definition: Event.h:52
Joystick connection/disconnection event parameters.
Definition: Event.h:157
float x
Definition: Event.h:194
A touch moved (data in event.touch)
Definition: Event.h:63
unsigned int joystickId
Definition: Event.h:137
Joystick buttons events parameters.
Definition: Event.h:146
float z
Definition: Event.h:196
int sfBool
Definition: Config.h:117
Mouse buttons events parameters.
Definition: Event.h:110
unsigned int button
Definition: Event.h:150
unsigned int height
Definition: Event.h:171
sfJoystickButtonEvent joystickButton
Joystick button event parameters.
Definition: Event.h:213
sfEventType type
Definition: Event.h:77
sfEvent defines a system event and its parameters
Definition: Event.h:203
float y
Definition: Event.h:195
A touch event ended (data in event.touch)
Definition: Event.h:64
sfBool alt
Definition: Event.h:79
sfEventType type
Definition: Event.h:159
The mouse cursor left the area of the window (no data)
Definition: Event.h:56
sfKeyCode code
Definition: Event.h:78
Sensor event parameters.
Definition: Event.h:190
sfSizeEvent size
Size event parameters.
Definition: Event.h:206
sfJoystickAxis
Axes supported by SFML joysticks.
Definition: Joystick.h:51
Joystick axis move event parameters.
Definition: Event.h:134
A character was entered (data in event.text)
Definition: Event.h:48
sfKeyEvent key
Key event parameters.
Definition: Event.h:207
sfEventType type
Definition: Event.h:91
unsigned int sfUint32
Definition: Config.h:140
sfEventType type
Type of the event.
Definition: Event.h:205
sfTouchEvent touch
Touch events parameters.
Definition: Event.h:215
The window lost the focus (no data)
Definition: Event.h:46
The mouse wheel was scrolled (data in event.mouseWheel)
Definition: Event.h:51
A joystick was connected (data in event.joystickConnect)
Definition: Event.h:60
sfEventType type
Definition: Event.h:136
sfSensorType
Sensor Types.
Definition: Sensor.h:40
A touch event began (data in event.touch)
Definition: Event.h:62
sfMouseButton button
Definition: Event.h:113
A joystick button was released (data in event.joystickButton)
Definition: Event.h:58
The mouse cursor entered the area of the window (no data)
Definition: Event.h:55
sfMouseMoveEvent mouseMove
Mouse move event parameters.
Definition: Event.h:209
A key was released (data in event.key)
Definition: Event.h:50
A joystick was disconnected (data in event.joystickConnect)
Definition: Event.h:61
sfSensorType sensorType
Definition: Event.h:193
The mouse cursor moved (data in event.mouseMove)
Definition: Event.h:54
The window requested to be closed (no data)
Definition: Event.h:44
sfMouseButtonEvent mouseButton
Mouse button event parameters.
Definition: Event.h:210
sfEventType
Definition of all the event types.
Definition: Event.h:42
sfTextEvent text
Text event parameters.
Definition: Event.h:208
sfMouseButton
Mouse buttons.
Definition: Mouse.h:40
A sensor value changed (data in event.sensor)
Definition: Event.h:65
unsigned int width
Definition: Event.h:170
A joystick button was pressed (data in event.joystickButton)
Definition: Event.h:57
sfEventType type
Definition: Event.h:169
Keep last – the total number of event types.
Definition: Event.h:67
sfEventType type
Definition: Event.h:148
Mouse move event parameters.
Definition: Event.h:99
sfBool system
Definition: Event.h:82
sfBool control
Definition: Event.h:80
sfKeyCode
Key codes.
Definition: Keyboard.h:38