SDL 3.0
|
#include <SDL3/SDL_stdinc.h>
#include <SDL3/SDL_error.h>
#include <SDL3/SDL_mouse.h>
#include <SDL3/SDL_begin_code.h>
#include <SDL3/SDL_close_code.h>
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_TouchID * | SDL_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) |
#define SDL_MOUSE_TOUCHID ((SDL_TouchID)-1) |
The SDL_TouchID for touch events simulated with mouse input.
Definition at line 122 of file SDL_touch.h.
#define SDL_TOUCH_MOUSEID ((SDL_MouseID)-1) |
The SDL_MouseID for mouse events simulated with touch input.
Definition at line 115 of file SDL_touch.h.
typedef Uint64 SDL_FingerID |
A unique ID for a single finger on a touch device.
This ID is valid for the time the finger (stylus, etc) is touching and will be unique for all fingers currently in contact, so this ID tracks the lifetime of a single continuous touch. This value may represent an index, a pointer, or some other unique ID, depending on the platform.
The value 0 is an invalid ID.
Definition at line 76 of file SDL_touch.h.
typedef Uint64 SDL_TouchID |
SDL offers touch input, on platforms that support it. It can manage multiple touch devices and track multiple fingers on those devices.
Touches are mostly dealt with through the event system, in the SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_MOTION, and SDL_EVENT_FINGER_UP events, but there are also functions to query for hardware details, etc.
The touch system, by default, will also send virtual mouse events; this can be useful for making a some desktop apps work on a phone without significant changes. For apps that care about mouse and touch input separately, they should ignore mouse events that have a which
field of SDL_TOUCH_MOUSEID. A unique ID for a touch device.
This ID is valid for the time the device is connected to the system, and is never reused for the lifetime of the application.
The value 0 is an invalid ID.
Definition at line 62 of file SDL_touch.h.
enum SDL_TouchDeviceType |
An enum that describes the type of a touch device.
Definition at line 83 of file SDL_touch.h.
const char * SDL_GetTouchDeviceName | ( | SDL_TouchID | touchID | ) |
Get the touch device name as reported from the driver.
touchID | the touch device instance ID. |
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.
count | a pointer filled in with the number of devices returned, may be NULL. |
SDL_TouchDeviceType SDL_GetTouchDeviceType | ( | SDL_TouchID | touchID | ) |
Get the type of the given touch device.
touchID | the ID of a touch device. |
SDL_Finger ** SDL_GetTouchFingers | ( | SDL_TouchID | touchID, |
int * | count | ||
) |
Get a list of active fingers for a given touch device.
touchID | the ID of a touch device. |
count | a pointer filled in with the number of fingers returned, can be NULL. |