SDL 3.0
SDL_TouchFingerEvent Struct Reference

#include <SDL_events.h>

Data Fields

SDL_EventType type
 
Uint32 reserved
 
Uint64 timestamp
 
SDL_TouchID touchID
 
SDL_FingerID fingerID
 
float x
 
float y
 
float dx
 
float dy
 
float pressure
 
SDL_WindowID windowID
 

Detailed Description

Touch finger event structure (event.tfinger.*)

Coordinates in this event are normalized. x and y are normalized to a range between 0.0f and 1.0f, relative to the window, so (0,0) is the top left and (1,1) is the bottom right. Delta coordinates dx and dy are normalized in the ranges of -1.0f (traversed all the way from the bottom or right to all the way up or left) to 1.0f (traversed all the way from the top or left to all the way down or right).

Note that while the coordinates are normalized, they are not clamped, which means in some circumstances you can get a value outside of this range. For example, a renderer using logical presentation might give a negative value when the touch is in the letterboxing. Some platforms might report a touch outside of the window, which will also be outside of the range.

Since
This struct is available since SDL 3.1.3.

Definition at line 766 of file SDL_events.h.

Field Documentation

◆ dx

float SDL_TouchFingerEvent::dx

Normalized in the range -1...1

Definition at line 775 of file SDL_events.h.

◆ dy

float SDL_TouchFingerEvent::dy

Normalized in the range -1...1

Definition at line 776 of file SDL_events.h.

◆ fingerID

SDL_FingerID SDL_TouchFingerEvent::fingerID

Definition at line 772 of file SDL_events.h.

◆ pressure

float SDL_TouchFingerEvent::pressure

Normalized in the range 0...1

Definition at line 777 of file SDL_events.h.

◆ reserved

Uint32 SDL_TouchFingerEvent::reserved

Definition at line 769 of file SDL_events.h.

◆ timestamp

Uint64 SDL_TouchFingerEvent::timestamp

In nanoseconds, populated using SDL_GetTicksNS()

Definition at line 770 of file SDL_events.h.

◆ touchID

SDL_TouchID SDL_TouchFingerEvent::touchID

The touch device id

Definition at line 771 of file SDL_events.h.

◆ type

SDL_EventType SDL_TouchFingerEvent::type

SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED

Definition at line 768 of file SDL_events.h.

◆ windowID

SDL_WindowID SDL_TouchFingerEvent::windowID

The window underneath the finger, if any

Definition at line 778 of file SDL_events.h.

◆ x

float SDL_TouchFingerEvent::x

Normalized in the range 0...1

Definition at line 773 of file SDL_events.h.

◆ y

float SDL_TouchFingerEvent::y

Normalized in the range 0...1

Definition at line 774 of file SDL_events.h.


The documentation for this struct was generated from the following file: