Loading...
Searching...
No Matches
Event.h
Go to the documentation of this file.
1
2//
3// SFML - Simple and Fast Multimedia Library
4// Copyright (C) 2007-2024 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>
34#include <SFML/Window/Mouse.h>
35#include <SFML/Window/Sensor.h>
36
37
70
71
86
96
101typedef struct
102{
104 int x;
105 int y;
107
119
134
147
159
164typedef struct
165{
167 unsigned int joystickId;
168 unsigned int button;
170
175typedef struct
176{
178 unsigned int joystickId;
180
185typedef struct
186{
188 unsigned int width;
189 unsigned int height;
191
196typedef struct
197{
199 unsigned int finger;
200 int x;
201 int y;
203
208typedef struct
209{
212 float x;
213 float y;
214 float z;
216
237
238
239#endif // SFML_EVENT_H
unsigned int sfUint32
Definition Config.h:176
int sfBool
Definition Config.h:153
#define CSFML_DEPRECATED
Definition Config.h:146
sfEventType
Definition of all the event types.
Definition Event.h:43
@ sfEvtCount
Keep last – the total number of event types.
Definition Event.h:68
@ sfEvtKeyPressed
A key was pressed (data in event.key)
Definition Event.h:49
@ sfEvtClosed
The window requested to be closed (no data)
Definition Event.h:44
@ sfEvtJoystickButtonReleased
A joystick button was released (data in event.joystickButton)
Definition Event.h:59
@ sfEvtJoystickConnected
A joystick was connected (data in event.joystickConnect)
Definition Event.h:61
@ sfEvtSensorChanged
A sensor value changed (data in event.sensor)
Definition Event.h:66
@ sfEvtJoystickDisconnected
A joystick was disconnected (data in event.joystickConnect)
Definition Event.h:62
@ sfEvtTextEntered
A character was entered (data in event.text)
Definition Event.h:48
@ sfEvtMouseWheelScrolled
The mouse wheel was scrolled (data in event.mouseWheelScroll)
Definition Event.h:52
@ sfEvtJoystickMoved
The joystick moved along an axis (data in event.joystickMove)
Definition Event.h:60
@ sfEvtMouseLeft
The mouse cursor left the area of the window (no data)
Definition Event.h:57
@ sfEvtMouseEntered
The mouse cursor entered the area of the window (no data)
Definition Event.h:56
@ sfEvtMouseButtonPressed
A mouse button was pressed (data in event.mouseButton)
Definition Event.h:53
@ sfEvtMouseButtonReleased
A mouse button was released (data in event.mouseButton)
Definition Event.h:54
@ sfEvtGainedFocus
The window gained the focus (no data)
Definition Event.h:47
@ sfEvtMouseMoved
The mouse cursor moved (data in event.mouseMove)
Definition Event.h:55
@ sfEvtKeyReleased
A key was released (data in event.key)
Definition Event.h:50
@ sfEvtResized
The window was resized (data in event.size)
Definition Event.h:45
@ sfEvtTouchEnded
A touch event ended (data in event.touch)
Definition Event.h:65
@ sfEvtTouchBegan
A touch event began (data in event.touch)
Definition Event.h:63
@ sfEvtTouchMoved
A touch moved (data in event.touch)
Definition Event.h:64
@ sfEvtJoystickButtonPressed
A joystick button was pressed (data in event.joystickButton)
Definition Event.h:58
@ sfEvtMouseWheelMoved
The mouse wheel was scrolled (data in event.mouseWheel) (deprecated)
Definition Event.h:51
@ sfEvtLostFocus
The window lost the focus (no data)
Definition Event.h:46
sfJoystickAxis
Axes supported by SFML joysticks.
Definition Joystick.h:52
sfScancode
Scancodes.
Definition Keyboard.h:170
sfKeyCode
Key codes.
Definition Keyboard.h:43
sfMouseWheel
Mouse wheels.
Definition Mouse.h:56
sfMouseButton
Mouse buttons.
Definition Mouse.h:41
sfSensorType
Sensor Types.
Definition Sensor.h:41
Joystick buttons events parameters.
Definition Event.h:165
sfEventType type
Definition Event.h:166
unsigned int joystickId
Definition Event.h:167
unsigned int button
Definition Event.h:168
Joystick connection/disconnection event parameters.
Definition Event.h:176
unsigned int joystickId
Definition Event.h:178
sfEventType type
Definition Event.h:177
Joystick axis move event parameters.
Definition Event.h:153
sfJoystickAxis axis
Definition Event.h:156
sfEventType type
Definition Event.h:154
unsigned int joystickId
Definition Event.h:155
Keyboard event parameters.
Definition Event.h:77
sfBool system
Definition Event.h:84
sfBool shift
Definition Event.h:83
sfBool alt
Definition Event.h:81
sfEventType type
Definition Event.h:78
sfBool control
Definition Event.h:82
sfScancode scancode
Definition Event.h:80
sfKeyCode code
Definition Event.h:79
Mouse buttons events parameters.
Definition Event.h:113
sfEventType type
Definition Event.h:114
sfMouseButton button
Definition Event.h:115
Mouse move event parameters.
Definition Event.h:102
sfEventType type
Definition Event.h:103
Mouse wheel events parameters.
Definition Event.h:128
sfEventType type
Definition Event.h:129
Mouse wheel events parameters.
Definition Event.h:140
sfMouseWheel wheel
Definition Event.h:142
sfEventType type
Definition Event.h:141
Sensor event parameters.
Definition Event.h:209
sfSensorType sensorType
Definition Event.h:211
float y
Definition Event.h:213
float x
Definition Event.h:212
float z
Definition Event.h:214
sfEventType type
Definition Event.h:210
Size events parameters.
Definition Event.h:186
unsigned int height
Definition Event.h:189
sfEventType type
Definition Event.h:187
unsigned int width
Definition Event.h:188
Text event parameters.
Definition Event.h:92
sfUint32 unicode
Definition Event.h:94
sfEventType type
Definition Event.h:93
Touch events parameters.
Definition Event.h:197
sfEventType type
Definition Event.h:198
unsigned int finger
Definition Event.h:199
sfEvent defines a system event and its parameters
Definition Event.h:222
sfJoystickConnectEvent joystickConnect
Joystick (dis)connect event parameters.
Definition Event.h:233
sfKeyEvent key
Key event parameters.
Definition Event.h:225
sfMouseMoveEvent mouseMove
Mouse move event parameters.
Definition Event.h:227
sfTouchEvent touch
Touch events parameters.
Definition Event.h:234
sfSizeEvent size
Size event parameters.
Definition Event.h:224
sfJoystickButtonEvent joystickButton
Joystick button event parameters.
Definition Event.h:232
sfMouseWheelEvent mouseWheel
Mouse wheel event parameters (deprecated)
Definition Event.h:229
sfSensorEvent sensor
Sensor event parameters.
Definition Event.h:235
sfJoystickMoveEvent joystickMove
Joystick move event parameters.
Definition Event.h:231
sfMouseButtonEvent mouseButton
Mouse button event parameters.
Definition Event.h:228
sfEventType type
Type of the event.
Definition Event.h:223
sfMouseWheelScrollEvent mouseWheelScroll
Mouse wheel event parameters.
Definition Event.h:230
sfTextEvent text
Text event parameters.
Definition Event.h:226