SDL_TouchFingerEvent - Touch finger event structure (event.tfinger.*)
Contents
Availability
This struct is available since SDL 3.2.0.
Simple Directmedia Layer SDL 3.2.10 SDL_TouchFingerEvent(3type)
Description
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.
Header File
Defined in SDL3/SDL_events.h
Name
SDL_TouchFingerEvent - Touch finger event structure (event.tfinger.*)
Synopsis
#include"SDL3/SDL.h"typedefstructSDL_TouchFingerEvent{SDL_EventTypetype;/**<SDL_EVENT_FINGER_DOWN,SDL_EVENT_FINGER_UP,SDL_EVENT_FINGER_MOTION,orSDL_EVENT_FINGER_CANCELED*/Uint32reserved;Uint64timestamp;/**<Innanoseconds,populatedusingSDL_GetTicksNS()*/SDL_TouchIDtouchID;/**<Thetouchdeviceid*/SDL_FingerIDfingerID;floatx;/**<Normalizedintherange0...1*/floaty;/**<Normalizedintherange0...1*/floatdx;/**<Normalizedintherange-1...1*/floatdy;/**<Normalizedintherange-1...1*/floatpressure;/**<Normalizedintherange0...1*/SDL_WindowIDwindowID;/**<Thewindowunderneaththefinger,ifany*/}SDL_TouchFingerEvent;