CSFML - C binding of the Simple and Fast Multimedia Library

CSFML

- Main Page
- Data Structures
- Files

- File List
- Globals

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 {
44 sfEvtClosed,
45 sfEvtResized,
46 sfEvtLostFocus,
47 sfEvtGainedFocus,
48 sfEvtTextEntered,
49 sfEvtKeyPressed,
50 sfEvtKeyReleased,
51 sfEvtMouseWheelMoved,
52 sfEvtMouseWheelScrolled,
53 sfEvtMouseButtonPressed,
54 sfEvtMouseButtonReleased,
55 sfEvtMouseMoved,
56 sfEvtMouseEntered,
57 sfEvtMouseLeft,
58 sfEvtJoystickButtonPressed,
59 sfEvtJoystickButtonReleased,
60 sfEvtJoystickMoved,
61 sfEvtJoystickConnected,
62 sfEvtJoystickDisconnected,
63 sfEvtTouchBegan,
64 sfEvtTouchMoved,
65 sfEvtTouchEnded,
66 sfEvtSensorChanged,
67
68 sfEvtCount,
69 } sfEventType;
70
71
76 typedef struct
77 {
78 sfEventType type;
79 sfKeyCode code;
80 sfBool alt;
81 sfBool control;
82 sfBool shift;
83 sfBool system;
84 } sfKeyEvent;
85
90 typedef struct
91 {
92 sfEventType type;
93 sfUint32 unicode;
94 } sfTextEvent;
95
100 typedef struct
101 {
102 sfEventType type;
103 int x;
104 int y;
105 } sfMouseMoveEvent;
106
111 typedef struct
112 {
113 sfEventType type;
114 sfMouseButton button;
115 int x;
116 int y;
117 } sfMouseButtonEvent;
118
123 typedef struct
124 {
125 sfEventType type;
126 int delta;
127 int x;
128 int y;
129 } sfMouseWheelEvent;
130
135 typedef struct
136 {
137 sfEventType type;
138 sfMouseWheel wheel;
139 float delta;
140 int x;
141 int y;
142 } sfMouseWheelScrollEvent;
143
148 typedef struct
149 {
150 sfEventType type;
151 unsigned int joystickId;
152 sfJoystickAxis axis;
153 float position;
154 } sfJoystickMoveEvent;
155
160 typedef struct
161 {
162 sfEventType type;
163 unsigned int joystickId;
164 unsigned int button;
165 } sfJoystickButtonEvent;
166
171 typedef struct
172 {
173 sfEventType type;
174 unsigned int joystickId;
175 } sfJoystickConnectEvent;
176
181 typedef struct
182 {
183 sfEventType type;
184 unsigned int width;
185 unsigned int height;
186 } sfSizeEvent;
187
192 typedef struct
193 {
194 sfEventType type;
195 unsigned int finger;
196 int x;
197 int y;
198 } sfTouchEvent;
199
204 typedef struct
205 {
206 sfEventType type;
207 sfSensorType sensorType;
208 float x;
209 float y;
210 float z;
211 } sfSensorEvent;
212
217 typedef union
218 {
219 sfEventType type;
220 sfSizeEvent size;
221 sfKeyEvent key;
222 sfTextEvent text;
223 sfMouseMoveEvent mouseMove;
224 sfMouseButtonEvent mouseButton;
225 sfMouseWheelEvent mouseWheel;
226 sfMouseWheelScrollEvent mouseWheelScroll;
227 sfJoystickMoveEvent joystickMove;
228 sfJoystickButtonEvent joystickButton;
229 sfJoystickConnectEvent joystickConnect;
230 sfTouchEvent touch;
231 sfSensorEvent sensor;
232 } sfEvent;
233
234
235 #endif // SFML_EVENT_H
Keyboard.h
sfJoystickMoveEvent::axis
sfJoystickAxis axis
Definition: Event.h:152
sfMouseWheelScrollEvent::y
int y
Definition: Event.h:141
sfEvtKeyPressed
A key was pressed (data in event.key)
Definition: Event.h:49
sfMouseWheelEvent::x
int x
Definition: Event.h:127
sfEvent::sensor
sfSensorEvent sensor
Sensor event parameters.
Definition: Event.h:231
sfSensorEvent::type
sfEventType type
Definition: Event.h:206
sfTextEvent
Text event parameters.
Definition: Event.h:90
sfEvtGainedFocus
The window gained the focus (no data)
Definition: Event.h:47
sfMouseWheelEvent::type
sfEventType type
Definition: Event.h:125
Mouse.h
sfKeyEvent
Keyboard event parameters.
Definition: Event.h:76
sfEvent::joystickConnect
sfJoystickConnectEvent joystickConnect
Joystick (dis)connect event parameters.
Definition: Event.h:229
sfEvtResized
The window was resized (data in event.size)
Definition: Event.h:45
sfEvtJoystickMoved
The joystick moved along an axis (data in event.joystickMove)
Definition: Event.h:60
sfMouseButtonEvent::type
sfEventType type
Definition: Event.h:113
sfTouchEvent::type
sfEventType type
Definition: Event.h:194
sfEvent::mouseWheel
sfMouseWheelEvent mouseWheel
Mouse wheel event parameters (deprecated)
Definition: Event.h:225
sfTouchEvent::finger
unsigned int finger
Definition: Event.h:195
sfTextEvent::unicode
sfUint32 unicode
Definition: Event.h:93
sfMouseMoveEvent::type
sfEventType type
Definition: Event.h:102
sfEvent::joystickMove
sfJoystickMoveEvent joystickMove
Joystick move event parameters.
Definition: Event.h:227
sfEvtMouseButtonReleased
A mouse button was released (data in event.mouseButton)
Definition: Event.h:54
sfTouchEvent::y
int y
Definition: Event.h:197
sfMouseWheelEvent
Mouse wheel events parameters (deprecated)
Definition: Event.h:123
sfJoystickConnectEvent::joystickId
unsigned int joystickId
Definition: Event.h:174
sfJoystickButtonEvent::joystickId
unsigned int joystickId
Definition: Event.h:163
sfTouchEvent
Touch events parameters.
Definition: Event.h:192
sfSizeEvent
Size events parameters.
Definition: Event.h:181
sfMouseWheelScrollEvent
Mouse wheel events parameters.
Definition: Event.h:135
sfKeyEvent::shift
sfBool shift
Definition: Event.h:82
sfEvtMouseButtonPressed
A mouse button was pressed (data in event.mouseButton)
Definition: Event.h:53
sfEvent::mouseWheelScroll
sfMouseWheelScrollEvent mouseWheelScroll
Mouse wheel event parameters.
Definition: Event.h:226
sfJoystickConnectEvent
Joystick connection/disconnection event parameters.
Definition: Event.h:171
sfSensorEvent::x
float x
Definition: Event.h:208
sfMouseWheelEvent::delta
int delta
Definition: Event.h:126
sfEvtTouchMoved
A touch moved (data in event.touch)
Definition: Event.h:64
sfJoystickMoveEvent::joystickId
unsigned int joystickId
Definition: Event.h:151
sfJoystickButtonEvent
Joystick buttons events parameters.
Definition: Event.h:160
Export.h
sfSensorEvent::z
float z
Definition: Event.h:210
sfBool
int sfBool
Definition: Config.h:117
sfMouseButtonEvent
Mouse buttons events parameters.
Definition: Event.h:111
sfJoystickButtonEvent::button
unsigned int button
Definition: Event.h:164
sfSizeEvent::height
unsigned int height
Definition: Event.h:185
sfEvent::joystickButton
sfJoystickButtonEvent joystickButton
Joystick button event parameters.
Definition: Event.h:228
sfKeyEvent::type
sfEventType type
Definition: Event.h:78
sfEvent
sfEvent defines a system event and its parameters
Definition: Event.h:217
sfSensorEvent::y
float y
Definition: Event.h:209
sfEvtTouchEnded
A touch event ended (data in event.touch)
Definition: Event.h:65
sfKeyEvent::alt
sfBool alt
Definition: Event.h:80
sfMouseWheelScrollEvent::delta
float delta
Definition: Event.h:139
sfJoystickConnectEvent::type
sfEventType type
Definition: Event.h:173
sfEvtMouseLeft
The mouse cursor left the area of the window (no data)
Definition: Event.h:57
sfJoystickMoveEvent::position
float position
Definition: Event.h:153
sfKeyEvent::code
sfKeyCode code
Definition: Event.h:79
sfSensorEvent
Sensor event parameters.
Definition: Event.h:204
sfEvent::size
sfSizeEvent size
Size event parameters.
Definition: Event.h:220
sfJoystickAxis
sfJoystickAxis
Axes supported by SFML joysticks.
Definition: Joystick.h:51
sfEvtMouseWheelScrolled
The mouse wheel was scrolled (data in event.mouseWheelScroll)
Definition: Event.h:52
sfJoystickMoveEvent
Joystick axis move event parameters.
Definition: Event.h:148
sfEvtTextEntered
A character was entered (data in event.text)
Definition: Event.h:48
sfMouseWheelScrollEvent::x
int x
Definition: Event.h:140
sfEvent::key
sfKeyEvent key
Key event parameters.
Definition: Event.h:221
sfTextEvent::type
sfEventType type
Definition: Event.h:92
sfMouseWheelEvent::y
int y
Definition: Event.h:128
sfUint32
unsigned int sfUint32
Definition: Config.h:140
sfEvent::type
sfEventType type
Type of the event.
Definition: Event.h:219
sfMouseMoveEvent::x
int x
Definition: Event.h:103
sfEvent::touch
sfTouchEvent touch
Touch events parameters.
Definition: Event.h:230
sfTouchEvent::x
int x
Definition: Event.h:196
sfEvtLostFocus
The window lost the focus (no data)
Definition: Event.h:46
sfEvtMouseWheelMoved
The mouse wheel was scrolled (data in event.mouseWheel) (deprecated)
Definition: Event.h:51
sfEvtJoystickConnected
A joystick was connected (data in event.joystickConnect)
Definition: Event.h:61
sfJoystickMoveEvent::type
sfEventType type
Definition: Event.h:150
sfSensorType
sfSensorType
Sensor Types.
Definition: Sensor.h:40
sfMouseWheelScrollEvent::wheel
sfMouseWheel wheel
Definition: Event.h:138
sfMouseMoveEvent::y
int y
Definition: Event.h:104
sfEvtTouchBegan
A touch event began (data in event.touch)
Definition: Event.h:63
sfMouseButtonEvent::button
sfMouseButton button
Definition: Event.h:114
sfEvtJoystickButtonReleased
A joystick button was released (data in event.joystickButton)
Definition: Event.h:59
sfEvtMouseEntered
The mouse cursor entered the area of the window (no data)
Definition: Event.h:56
sfEvent::mouseMove
sfMouseMoveEvent mouseMove
Mouse move event parameters.
Definition: Event.h:223
sfEvtKeyReleased
A key was released (data in event.key)
Definition: Event.h:50
sfEvtJoystickDisconnected
A joystick was disconnected (data in event.joystickConnect)
Definition: Event.h:62
sfMouseWheelScrollEvent::type
sfEventType type
Definition: Event.h:137
sfSensorEvent::sensorType
sfSensorType sensorType
Definition: Event.h:207
sfEvtMouseMoved
The mouse cursor moved (data in event.mouseMove)
Definition: Event.h:55
sfEvtClosed
The window requested to be closed (no data)
Definition: Event.h:44
sfEvent::mouseButton
sfMouseButtonEvent mouseButton
Mouse button event parameters.
Definition: Event.h:224
sfMouseWheel
sfMouseWheel
Mouse wheels.
Definition: Mouse.h:55
sfEventType
sfEventType
Definition of all the event types.
Definition: Event.h:42
sfEvent::text
sfTextEvent text
Text event parameters.
Definition: Event.h:222
sfMouseButton
sfMouseButton
Mouse buttons.
Definition: Mouse.h:40
sfMouseButtonEvent::y
int y
Definition: Event.h:116
sfEvtSensorChanged
A sensor value changed (data in event.sensor)
Definition: Event.h:66
sfSizeEvent::width
unsigned int width
Definition: Event.h:184
sfEvtJoystickButtonPressed
A joystick button was pressed (data in event.joystickButton)
Definition: Event.h:58
Joystick.h
Sensor.h
sfSizeEvent::type
sfEventType type
Definition: Event.h:183
sfEvtCount
Keep last â€“ the total number of event types.
Definition: Event.h:68
sfJoystickButtonEvent::type
sfEventType type
Definition: Event.h:162
sfMouseButtonEvent::x
int x
Definition: Event.h:115
sfMouseMoveEvent
Mouse move event parameters.
Definition: Event.h:100
sfKeyEvent::system
sfBool system
Definition: Event.h:83
sfKeyEvent::control
sfBool control
Definition: Event.h:81
sfKeyCode
sfKeyCode
Key codes.
Definition: Keyboard.h:38