31#include <SFML/Config.hpp>
32#include <SFML/Window/Joystick.hpp>
33#include <SFML/Window/Keyboard.hpp>
34#include <SFML/Window/Mouse.hpp>
35#include <SFML/Window/Sensor.hpp>
Defines a system event and its parameters.
TextEvent text
Text event parameters (Event::TextEntered)
MouseButtonEvent mouseButton
Mouse button event parameters (Event::MouseButtonPressed, Event::MouseButtonReleased)
JoystickButtonEvent joystickButton
Joystick button event parameters (Event::JoystickButtonPressed, Event::JoystickButtonReleased)
KeyEvent key
Key event parameters (Event::KeyPressed, Event::KeyReleased)
TouchEvent touch
Touch events parameters (Event::TouchBegan, Event::TouchMoved, Event::TouchEnded)
MouseWheelScrollEvent mouseWheelScroll
Mouse wheel event parameters (Event::MouseWheelScrolled)
MouseMoveEvent mouseMove
Mouse move event parameters (Event::MouseMoved)
SizeEvent size
Size event parameters (Event::Resized)
MouseWheelEvent mouseWheel
Mouse wheel event parameters (Event::MouseWheelMoved) (deprecated)
JoystickConnectEvent joystickConnect
Joystick (dis)connect event parameters (Event::JoystickConnected, Event::JoystickDisconnected)
JoystickMoveEvent joystickMove
Joystick move event parameters (Event::JoystickMoved)
SensorEvent sensor
Sensor event parameters (Event::SensorChanged)
EventType type
Type of the event.
EventType
Enumeration of the different types of events.
@ JoystickButtonReleased
A joystick button was released (data in event.joystickButton)
@ MouseWheelScrolled
The mouse wheel was scrolled (data in event.mouseWheelScroll)
@ Closed
The window requested to be closed (no data)
@ JoystickMoved
The joystick moved along an axis (data in event.joystickMove)
@ MouseMoved
The mouse cursor moved (data in event.mouseMove)
@ MouseEntered
The mouse cursor entered the area of the window (no data)
@ MouseButtonPressed
A mouse button was pressed (data in event.mouseButton)
@ MouseWheelMoved
The mouse wheel was scrolled (data in event.mouseWheel) (deprecated)
@ Resized
The window was resized (data in event.size)
@ JoystickButtonPressed
A joystick button was pressed (data in event.joystickButton)
@ TextEntered
A character was entered (data in event.text)
@ GainedFocus
The window gained the focus (no data)
@ TouchMoved
A touch moved (data in event.touch)
@ MouseButtonReleased
A mouse button was released (data in event.mouseButton)
@ KeyReleased
A key was released (data in event.key)
@ MouseLeft
The mouse cursor left the area of the window (no data)
@ JoystickConnected
A joystick was connected (data in event.joystickConnect)
@ SensorChanged
A sensor value changed (data in event.sensor)
@ JoystickDisconnected
A joystick was disconnected (data in event.joystickConnect)
@ TouchEnded
A touch event ended (data in event.touch)
@ LostFocus
The window lost the focus (no data)
@ KeyPressed
A key was pressed (data in event.key)
@ Count
Keep last – the total number of event types.
@ TouchBegan
A touch event began (data in event.touch)
Axis
Axes supported by SFML joysticks.
Joystick connection events parameters (JoystickConnected, JoystickDisconnected)
unsigned int joystickId
Index of the joystick (in range [0 .. Joystick::Count - 1])
Joystick axis move event parameters (JoystickMoved)
unsigned int joystickId
Index of the joystick (in range [0 .. Joystick::Count - 1])
float position
New position on the axis (in range [-100 .. 100])
Joystick::Axis axis
Axis on which the joystick moved.
Keyboard event parameters (KeyPressed, KeyReleased)
Keyboard::Scancode scancode
Physical code of the key that has been pressed.
Keyboard::Key code
Code of the key that has been pressed.
bool shift
Is the Shift key pressed?
bool alt
Is the Alt key pressed?
bool control
Is the Control key pressed?
bool system
Is the System key pressed?
Mouse move event parameters (MouseMoved)
int y
Y position of the mouse pointer, relative to the top of the owner window.
int x
X position of the mouse pointer, relative to the left of the owner window.
Mouse wheel events parameters (MouseWheelMoved)
int x
X position of the mouse pointer, relative to the left of the owner window.
int delta
Number of ticks the wheel has moved (positive is up, negative is down)
int y
Y position of the mouse pointer, relative to the top of the owner window.
Sensor event parameters (SensorChanged)
float z
Current value of the sensor on Z axis.
float x
Current value of the sensor on X axis.
Sensor::Type type
Type of the sensor.
float y
Current value of the sensor on Y axis.
Size events parameters (Resized)
unsigned int width
New width, in pixels.
unsigned int height
New height, in pixels.
Text event parameters (TextEntered)
Uint32 unicode
UTF-32 Unicode value of the character.
Touch events parameters (TouchBegan, TouchMoved, TouchEnded)
int x
X position of the touch, relative to the left of the owner window.
unsigned int finger
Index of the finger in case of multi-touch events.
int y
Y position of the touch, relative to the top of the owner window.