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 //
25 #ifndef SFML_EVENT_H
26 #define SFML_EVENT_H
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>
42 typedef enum
43 {
69 } sfEventType;
76 typedef struct
77 {
84 } sfKeyEvent;
90 typedef struct
91 {
94 } sfTextEvent;
100 typedef struct
101 {
103  int x;
104  int y;
111 typedef struct
112 {
115  int x;
116  int y;
126 typedef struct CSFML_DEPRECATED
127 {
129  int delta;
130  int x;
131  int y;
138 typedef struct
139 {
142  float delta;
143  int x;
144  int y;
151 typedef struct
152 {
154  unsigned int joystickId;
156  float position;
163 typedef struct
164 {
166  unsigned int joystickId;
167  unsigned int button;
174 typedef struct
175 {
177  unsigned int joystickId;
184 typedef struct
185 {
187  unsigned int width;
188  unsigned int height;
189 } sfSizeEvent;
195 typedef struct
196 {
198  unsigned int finger;
199  int x;
200  int y;
201 } sfTouchEvent;
207 typedef struct
208 {
211  float x;
212  float y;
213  float z;
214 } sfSensorEvent;
220 typedef union
221 {
235 } sfEvent;
238 #endif // SFML_EVENT_H
sfJoystickAxis axis
Definition: Event.h:155
A key was pressed (data in event.key)
Definition: Event.h:49
sfSensorEvent sensor
Sensor event parameters.
Definition: Event.h:234
sfEventType type
Definition: Event.h:209
Text event parameters.
Definition: Event.h:90
The window gained the focus (no data)
Definition: Event.h:47
Keyboard event parameters.
Definition: Event.h:76
sfJoystickConnectEvent joystickConnect
Joystick (dis)connect event parameters.
Definition: Event.h:232
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:197
sfMouseWheelEvent mouseWheel
Mouse wheel event parameters (deprecated)
Definition: Event.h:228
unsigned int finger
Definition: Event.h:198
sfUint32 unicode
Definition: Event.h:93
sfEventType type
Definition: Event.h:102
sfJoystickMoveEvent joystickMove
Joystick move event parameters.
Definition: Event.h:230
Mouse wheel events parameters.
Definition: Event.h:126
A mouse button was released (data in event.mouseButton)
Definition: Event.h:54
unsigned int joystickId
Definition: Event.h:177
unsigned int joystickId
Definition: Event.h:166
Touch events parameters.
Definition: Event.h:195
Size events parameters.
Definition: Event.h:184
Mouse wheel events parameters.
Definition: Event.h:138
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:229
Joystick connection/disconnection event parameters.
Definition: Event.h:174
float x
Definition: Event.h:211
A touch moved (data in event.touch)
Definition: Event.h:64
unsigned int joystickId
Definition: Event.h:154
Joystick buttons events parameters.
Definition: Event.h:163
float z
Definition: Event.h:213
int sfBool
Definition: Config.h:153
Mouse buttons events parameters.
Definition: Event.h:111
unsigned int button
Definition: Event.h:167
unsigned int height
Definition: Event.h:188
sfJoystickButtonEvent joystickButton
Joystick button event parameters.
Definition: Event.h:231
sfEventType type
Definition: Event.h:128
struct CSFML_DEPRECATED sfMouseWheelEvent
Mouse wheel events parameters.
sfEventType type
Definition: Event.h:78
sfEvent defines a system event and its parameters
Definition: Event.h:220
float y
Definition: Event.h:212
A touch event ended (data in event.touch)
Definition: Event.h:65
sfBool alt
Definition: Event.h:80
sfEventType type
Definition: Event.h:176
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:207
sfSizeEvent size
Size event parameters.
Definition: Event.h:223
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:151
A character was entered (data in event.text)
Definition: Event.h:48
sfKeyEvent key
Key event parameters.
Definition: Event.h:224
sfEventType type
Definition: Event.h:92
unsigned int sfUint32
Definition: Config.h:176
sfEventType type
Type of the event.
Definition: Event.h:222
sfTouchEvent touch
Touch events parameters.
Definition: Event.h:233
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:153
Sensor Types.
Definition: Sensor.h:40
sfMouseWheel wheel
Definition: Event.h:141
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:226
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:140
sfSensorType sensorType
Definition: Event.h:210
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:227
Mouse wheels.
Definition: Mouse.h:55
Definition of all the event types.
Definition: Event.h:42
sfTextEvent text
Text event parameters.
Definition: Event.h:225
Mouse buttons.
Definition: Mouse.h:40
A sensor value changed (data in event.sensor)
Definition: Event.h:66
unsigned int width
Definition: Event.h:187
A joystick button was pressed (data in event.joystickButton)
Definition: Event.h:58
sfEventType type
Definition: Event.h:186
Keep last – the total number of event types.
Definition: Event.h:68
sfEventType type
Definition: Event.h:165
Mouse move event parameters.
Definition: Event.h:100
sfBool system
Definition: Event.h:83
sfBool control
Definition: Event.h:81
Key codes.
Definition: Keyboard.h:38