SDL 3.0
SDL_touch.h File Reference
+ Include dependency graph for SDL_touch.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  SDL_Finger
 

Macros

#define SDL_TOUCH_MOUSEID   ((SDL_MouseID)-1)
 
#define SDL_MOUSE_TOUCHID   ((SDL_TouchID)-1)
 

Typedefs

typedef Uint64 SDL_TouchID
 
typedef Uint64 SDL_FingerID
 

Enumerations

enum  SDL_TouchDeviceType {
  SDL_TOUCH_DEVICE_INVALID = -1 ,
  SDL_TOUCH_DEVICE_DIRECT ,
  SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE ,
  SDL_TOUCH_DEVICE_INDIRECT_RELATIVE
}
 

Functions

SDL_TouchIDSDL_GetTouchDevices (int *count)
 
const char * SDL_GetTouchDeviceName (SDL_TouchID touchID)
 
SDL_TouchDeviceType SDL_GetTouchDeviceType (SDL_TouchID touchID)
 
SDL_Finger ** SDL_GetTouchFingers (SDL_TouchID touchID, int *count)
 

Macro Definition Documentation

◆ SDL_MOUSE_TOUCHID

#define SDL_MOUSE_TOUCHID   ((SDL_TouchID)-1)

Definition at line 75 of file SDL_touch.h.

◆ SDL_TOUCH_MOUSEID

#define SDL_TOUCH_MOUSEID   ((SDL_MouseID)-1)

Definition at line 72 of file SDL_touch.h.

Typedef Documentation

◆ SDL_FingerID

Definition at line 42 of file SDL_touch.h.

◆ SDL_TouchID

CategoryTouch

SDL touch management.

Definition at line 41 of file SDL_touch.h.

Enumeration Type Documentation

◆ SDL_TouchDeviceType

Enumerator
SDL_TOUCH_DEVICE_INVALID 
SDL_TOUCH_DEVICE_DIRECT 
SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE 
SDL_TOUCH_DEVICE_INDIRECT_RELATIVE 

Definition at line 44 of file SDL_touch.h.

45{
47 SDL_TOUCH_DEVICE_DIRECT, /* touch screen with window-relative coordinates */
48 SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE, /* trackpad with absolute device coordinates */
49 SDL_TOUCH_DEVICE_INDIRECT_RELATIVE /* trackpad with screen cursor-relative coordinates */
SDL_TouchDeviceType
Definition: SDL_touch.h:45
@ SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE
Definition: SDL_touch.h:48
@ SDL_TOUCH_DEVICE_DIRECT
Definition: SDL_touch.h:47
@ SDL_TOUCH_DEVICE_INDIRECT_RELATIVE
Definition: SDL_touch.h:49
@ SDL_TOUCH_DEVICE_INVALID
Definition: SDL_touch.h:46

Function Documentation

◆ SDL_GetTouchDeviceName()

const char * SDL_GetTouchDeviceName ( SDL_TouchID  touchID)

Get the touch device name as reported from the driver.

Parameters
touchIDthe touch device instance ID.
Returns
touch device name, or NULL on failure; call SDL_GetError() for more information.
Since
This function is available since SDL 3.1.3.

◆ SDL_GetTouchDevices()

SDL_TouchID * SDL_GetTouchDevices ( int *  count)

Get a list of registered touch devices.

On some platforms SDL first sees the touch device if it was actually used. Therefore the returned list might be empty, although devices are available. After using all devices at least once the number will be correct.

Parameters
counta pointer filled in with the number of devices returned, may be NULL.
Returns
a 0 terminated array of touch device IDs or NULL on failure; call SDL_GetError() for more information. This should be freed with SDL_free() when it is no longer needed.
Since
This function is available since SDL 3.1.3.

◆ SDL_GetTouchDeviceType()

SDL_TouchDeviceType SDL_GetTouchDeviceType ( SDL_TouchID  touchID)

Get the type of the given touch device.

Parameters
touchIDthe ID of a touch device.
Returns
touch device type.
Since
This function is available since SDL 3.1.3.

◆ SDL_GetTouchFingers()

SDL_Finger ** SDL_GetTouchFingers ( SDL_TouchID  touchID,
int *  count 
)

Get a list of active fingers for a given touch device.

Parameters
touchIDthe ID of a touch device.
counta pointer filled in with the number of fingers returned, can be NULL.
Returns
a NULL terminated array of SDL_Finger pointers or NULL on failure; call SDL_GetError() for more information. This is a single allocation that should be freed with SDL_free() when it is no longer needed.
Since
This function is available since SDL 3.1.3.