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#pragma once
26
28// Headers
30#include <CSFML/Window/Export.h>
31
34#include <CSFML/Window/Mouse.h>
35#include <CSFML/Window/Sensor.h>
36
37
70
71
86
91typedef struct
92{
94 uint32_t unicode;
96
106
116
127
139
151
156typedef struct
157{
159 unsigned int joystickId;
160 unsigned int button;
162
167typedef struct
168{
170 unsigned int joystickId;
172
182
187typedef struct
188{
190 unsigned int finger;
193
204
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
@ sfEvtMouseMovedRaw
The mouse cursor moved (data in event.mouseMove)
Definition Event.h:55
@ 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:51
@ 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
@ sfEvtFocusGained
The window gained the focus (no data)
Definition Event.h:47
@ 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:52
@ sfEvtMouseButtonReleased
A mouse button was released (data in event.mouseButton)
Definition Event.h:53
@ sfEvtMouseMoved
The mouse cursor moved (data in event.mouseMove)
Definition Event.h:54
@ 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
@ sfEvtFocusLost
The window lost the focus (no data)
Definition Event.h:46
@ 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
sfJoystickAxis
Axes supported by SFML joysticks.
Definition Joystick.h:52
sfScancode
Scancodes.
Definition Keyboard.h:161
sfKeyCode
Key codes.
Definition Keyboard.h:42
sfMouseWheel
Mouse wheels.
Definition Mouse.h:59
sfMouseButton
Mouse buttons.
Definition Mouse.h:41
sfSensorType
Sensor Types.
Definition Sensor.h:41
Joystick buttons events parameters.
Definition Event.h:157
sfEventType type
Definition Event.h:158
unsigned int joystickId
Definition Event.h:159
unsigned int button
Definition Event.h:160
Joystick connection/disconnection event parameters.
Definition Event.h:168
unsigned int joystickId
Definition Event.h:170
sfEventType type
Definition Event.h:169
Joystick axis move event parameters.
Definition Event.h:145
sfJoystickAxis axis
Definition Event.h:148
sfEventType type
Definition Event.h:146
unsigned int joystickId
Definition Event.h:147
Keyboard event parameters.
Definition Event.h:77
bool alt
Definition Event.h:81
bool system
Definition Event.h:84
bool shift
Definition Event.h:83
bool control
Definition Event.h:82
sfEventType type
Definition Event.h:78
sfScancode scancode
Definition Event.h:80
sfKeyCode code
Definition Event.h:79
Mouse buttons events parameters.
Definition Event.h:122
sfVector2i position
Definition Event.h:125
sfEventType type
Definition Event.h:123
sfMouseButton button
Definition Event.h:124
Mouse move event parameters.
Definition Event.h:102
sfEventType type
Definition Event.h:103
sfVector2i position
Definition Event.h:104
Mouse move raw event parameters.
Definition Event.h:112
sfVector2i delta
Definition Event.h:114
sfEventType type
Definition Event.h:113
Mouse wheel events parameters.
Definition Event.h:133
sfVector2i position
Definition Event.h:137
sfMouseWheel wheel
Definition Event.h:135
sfEventType type
Definition Event.h:134
Sensor event parameters.
Definition Event.h:199
sfVector3f value
Definition Event.h:202
sfSensorType sensorType
Definition Event.h:201
sfEventType type
Definition Event.h:200
Size events parameters.
Definition Event.h:178
sfEventType type
Definition Event.h:179
sfVector2u size
Definition Event.h:180
Text event parameters.
Definition Event.h:92
sfEventType type
Definition Event.h:93
uint32_t unicode
Definition Event.h:94
Touch events parameters.
Definition Event.h:188
sfEventType type
Definition Event.h:189
unsigned int finger
Definition Event.h:190
sfVector2i position
Definition Event.h:191
2-component vector of integers
Definition Vector2.h:38
2-component vector of unsigned integers
Definition Vector2.h:49
3-component vector of floats
Definition Vector3.h:38
sfEvent defines a system event and its parameters
Definition Event.h:210
sfJoystickConnectEvent joystickConnect
Joystick (dis)connect event parameters.
Definition Event.h:221
sfKeyEvent key
Key event parameters.
Definition Event.h:213
sfMouseMoveEvent mouseMove
Mouse move event parameters.
Definition Event.h:215
sfTouchEvent touch
Touch events parameters.
Definition Event.h:222
sfSizeEvent size
Size event parameters.
Definition Event.h:212
sfJoystickButtonEvent joystickButton
Joystick button event parameters.
Definition Event.h:220
sfMouseMoveRawEvent mouseMoveRaw
Mouse move raw event parameters.
Definition Event.h:216
sfSensorEvent sensor
Sensor event parameters.
Definition Event.h:223
sfJoystickMoveEvent joystickMove
Joystick move event parameters.
Definition Event.h:219
sfMouseButtonEvent mouseButton
Mouse button event parameters.
Definition Event.h:217
sfEventType type
Type of the event.
Definition Event.h:211
sfMouseWheelScrollEvent mouseWheelScroll
Mouse wheel event parameters.
Definition Event.h:218
sfTextEvent text
Text event parameters.
Definition Event.h:214