305 template <
typename TEventSubtype>
306 Event(
const TEventSubtype& eventSubtype);
316 template <
typename TEventSubtype>
317 [[nodiscard]]
bool is()
const;
327 template <
typename TEventSubtype>
328 [[nodiscard]]
const TEventSubtype*
getIf()
const;
338 template <
typename T>
339 decltype(
auto)
visit(T&& visitor)
const;
373 template <
typename T,
typename... Ts>
374 [[nodiscard]]
static constexpr bool isInParameterPack(
const std::variant<Ts...>*)
376 return (std::is_same_v<T, Ts> || ...);
379 template <
typename T>
380 static constexpr bool isEventSubtype = isInParameterPack<T>(
decltype (&m_data)(
nullptr));
385#include <SFML/Window/Event.inl>
const TEventSubtype * getIf() const
Attempt to get specified event subtype.
bool is() const
Check current event subtype.
Event(const TEventSubtype &eventSubtype)
Construct from a given sf::Event subtype.
decltype(auto) visit(T &&visitor) const
Apply a visitor to the event.
Axis
Axes supported by SFML joysticks.
Vector3< float > Vector3f
Vector2< unsigned int > Vector2u
Gained focus event subtype.
Lost focus event subtype.
Joystick connected event subtype.
unsigned int joystickId
Index of the joystick (in range [0 .. Joystick::Count - 1])
Joystick disconnected event subtype.
unsigned int joystickId
Index of the joystick (in range [0 .. Joystick::Count - 1])
Joystick axis move event subtype.
unsigned int joystickId
Index of the joystick (in range [0 .. Joystick::Count - 1])
Joystick::Axis axis
Axis on which the joystick moved.
float position
New position on the axis (in range [-100 .. 100])
Key pressed event subtype.
bool system
Is the System key pressed?
bool control
Is the Control key pressed?
bool shift
Is the Shift key pressed?
bool alt
Is the Alt key pressed?
Keyboard::Key code
Code of the key that has been pressed.
Keyboard::Scancode scancode
Physical code of the key that has been pressed.
Key released event subtype.
bool alt
Is the Alt key pressed?
bool control
Is the Control key pressed?
bool shift
Is the Shift key pressed?
bool system
Is the System key pressed?
Keyboard::Key code
Code of the key that has been released.
Keyboard::Scancode scancode
Physical code of the key that has been released.
Mouse entered event subtype.
Mouse left event subtype.
Mouse move raw event subtype.
Vector2i delta
Delta movement of the mouse since the last event.
Mouse move event subtype.
Vector2i position
Position of the mouse pointer, relative to the top left of the owner window.
Vector2u size
New size, in pixels.
Sensor::Type type
Type of the sensor.
Vector3f value
Current value of the sensor on the X, Y, and Z axes.
char32_t unicode
UTF-32 Unicode value of the character.
Touch began event subtype.
Vector2i position
Start position of the touch, relative to the top left of the owner window.
unsigned int finger
Index of the finger in case of multi-touch events.
Touch ended event subtype.
Vector2i position
Final position of the touch, relative to the top left of the owner window.
unsigned int finger
Index of the finger in case of multi-touch events.
Touch moved event subtype.
Vector2i position
Current position of the touch, relative to the top left of the owner window.
unsigned int finger
Index of the finger in case of multi-touch events.