Ultibo API
C/C++ API for Ultibo Core
Loading...
Searching...
No Matches
touch.h File Reference

Go to the source code of this file.

Data Structures

struct  _TOUCH_DATA
struct  _TOUCH_BUFFER
struct  _TOUCH_PROPERTIES
struct  _TOUCH_DEVICE

Macros

#define TOUCH_NAME_PREFIX   "Touch"
 Name prefix for Touch Devices.
#define TOUCH_TYPE_NONE   0
#define TOUCH_TYPE_RESISTIVE   1
#define TOUCH_TYPE_CAPACITIVE   2
#define TOUCH_TYPE_MAX   2
#define TOUCH_STATE_DISABLED   0
#define TOUCH_STATE_ENABLED   1
#define TOUCH_STATE_MAX   1
#define TOUCH_FLAG_NONE   0x00000000
#define TOUCH_FLAG_NON_BLOCK   0x00000001
 If set device reads are non blocking (Also supported in Flags parameter of TouchDeviceRead).
#define TOUCH_FLAG_PEEK_BUFFER   0x00000002
 Peek at the buffer to see if any data is available, don't remove it (Used only in Flags parameter of TouchDeviceRead).
#define TOUCH_FLAG_MOUSE_DATA   0x00000004
 If set the device will write a mouse data event for each touch event.
#define TOUCH_FLAG_MULTI_POINT   0x00000008
 If set the device supports multi point touch.
#define TOUCH_FLAG_PRESSURE   0x00000010
 If set the device supports pressure value on touch points.
#define TOUCH_FLAG_SWAP_XY   0x00000020
 If set swap the X and Y coordinates.
#define TOUCH_FLAG_INVERT_X   0x00000040
 If set invert the X coordinate.
#define TOUCH_FLAG_INVERT_Y   0x00000080
 If set invert the Y coordinate.
#define TOUCH_FLAG_SWAP_MAX_XY   0x00000100
 If set swap the maximum X and Y values.
#define TOUCH_FLAG_RELEASE_TIMER   0x00000200
 If set enable the touch release timer for devices that don't provide release events.
#define TOUCH_FLAG_MASK   TOUCH_FLAG_NON_BLOCK | TOUCH_FLAG_MOUSE_DATA | TOUCH_FLAG_MULTI_POINT | TOUCH_FLAG_PRESSURE | TOUCH_FLAG_SWAP_XY | TOUCH_FLAG_INVERT_X | TOUCH_FLAG_INVERT_Y | TOUCH_FLAG_SWAP_MAX_XY | TOUCH_FLAG_RELEASE_TIMER
#define TOUCH_CONTROL_GET_FLAG   1
 Get Flag.
#define TOUCH_CONTROL_SET_FLAG   2
 Set Flag.
#define TOUCH_CONTROL_CLEAR_FLAG   3
 Clear Flag.
#define TOUCH_CONTROL_FLUSH_BUFFER   4
 Flush Buffer.
#define TOUCH_CONTROL_GET_WIDTH   5
 Get Screen Width.
#define TOUCH_CONTROL_GET_HEIGHT   6
 Get Screen Height.
#define TOUCH_CONTROL_GET_MAX_X   7
 Get Maximum X value (Only applies to Absolute X values).
#define TOUCH_CONTROL_GET_MAX_Y   8
 Get Maximum Y value (Only applies to Absolute Y values).
#define TOUCH_CONTROL_GET_MAX_Z   9
 Get Maximum Z value (Only applies to Absolute Z values).
#define TOUCH_CONTROL_GET_MAX_POINTS   10
 Get Maximum number of Touch Points.
#define TOUCH_CONTROL_GET_ROTATION   11
 Get Rotation value (0, 90, 180, 270)(Only where supported by the driver).
#define TOUCH_CONTROL_SET_ROTATION   12
 Set Rotation value (0, 90, 180, 270)(Only where supported by the driver).
#define TOUCH_CONTROL_GET_CALLBACK   13
 Get the registered callback function for touch events.
#define TOUCH_CONTROL_SET_CALLBACK   14
 Set the registered callback function for touch events.
#define TOUCH_BUFFER_SIZE   1024
#define TOUCH_FINGER   0x00000001
 A finger is pressed at this touch point.
#define TOUCH_ID_UNKNOWN   (uint16_t)-1
#define TOUCH_X_UNKNOWN   -1
#define TOUCH_Y_UNKNOWN   -1
#define TOUCH_Z_UNKNOWN   -1
#define TOUCH_ROTATION_0   FRAMEBUFFER_ROTATION_0
 No rotation.
#define TOUCH_ROTATION_90   FRAMEBUFFER_ROTATION_90
 90 degree rotation
#define TOUCH_ROTATION_180   FRAMEBUFFER_ROTATION_180
 180 degree rotation
#define TOUCH_ROTATION_270   FRAMEBUFFER_ROTATION_270
 270 degree rotation

Typedefs

typedef struct _TOUCH_DATA TOUCH_DATA
typedef struct _TOUCH_BUFFER TOUCH_BUFFER
typedef struct _TOUCH_PROPERTIES TOUCH_PROPERTIES
typedef struct _TOUCH_DEVICE TOUCH_DEVICE
typedef uint32_t STDCALL(* touch_event_cb) (TOUCH_DEVICE *touch, TOUCH_DATA *data)
typedef uint32_t STDCALL(* touch_enumerate_cb) (TOUCH_DEVICE *touch, void *data)
typedef uint32_t STDCALL(* touch_notification_cb) (DEVICE *device, void *data, uint32_t notification)
typedef uint32_t STDCALL(* touch_device_start_proc) (TOUCH_DEVICE *touch)
typedef uint32_t STDCALL(* touch_device_stop_proc) (TOUCH_DEVICE *touch)
typedef uint32_t STDCALL(* touch_device_peek_proc) (TOUCH_DEVICE *touch)
typedef uint32_t STDCALL(* touch_device_read_proc) (TOUCH_DEVICE *touch, void *buffer, uint32_t size, uint32_t flags, uint32_t *count)
typedef uint32_t STDCALL(* touch_device_write_proc) (TOUCH_DEVICE *touch, void *buffer, uint32_t size, uint32_t count)
typedef uint32_t STDCALL(* touch_device_flush_proc) (TOUCH_DEVICE *touch)
typedef uint32_t STDCALL(* touch_device_update_proc) (TOUCH_DEVICE *touch)
typedef uint32_t STDCALL(* touch_device_control_proc) (TOUCH_DEVICE *touch, int request, size_t argument1, size_t *argument2)
typedef uint32_t STDCALL(* touch_device_get_properties_proc) (TOUCH_DEVICE *touch, TOUCH_PROPERTIES *properties)

Functions

uint32_t STDCALL touch_device_start (TOUCH_DEVICE *touch)
 Start the specified Touch device ready for receiving events.
uint32_t STDCALL touch_device_stop (TOUCH_DEVICE *touch)
 Stop the specified Touch device and terminate receiving events.
uint32_t STDCALL touch_device_peek (TOUCH_DEVICE *touch)
 Peek at the buffer of the specified touch device to see if any data packets are ready.
uint32_t STDCALL touch_device_read (TOUCH_DEVICE *touch, void *buffer, uint32_t size, uint32_t flags, uint32_t *count)
 Read touch data packets from the buffer of the specified touch device.
uint32_t STDCALL touch_device_write (TOUCH_DEVICE *touch, void *buffer, uint32_t size, uint32_t count)
 Write touch data packets to the buffer of the specified touch device.
uint32_t STDCALL touch_device_flush (TOUCH_DEVICE *touch)
 Flush the contents of the buffer of the specified touch device.
uint32_t STDCALL touch_device_update (TOUCH_DEVICE *touch)
 Request the specified touch device to update the current configuration.
uint32_t STDCALL touch_device_control (TOUCH_DEVICE *touch, int request, size_t argument1, size_t *argument2)
 Perform a control request on the specified touch device.
uint32_t STDCALL touch_device_properties (TOUCH_DEVICE *touch, TOUCH_PROPERTIES *properties)
 Get the properties for the specified Touch device.
uint32_t STDCALL touch_device_get_properties (TOUCH_DEVICE *touch, TOUCH_PROPERTIES *properties)
 Get the properties for the specified Touch device.
TOUCH_DEVICE *STDCALL touch_device_create (void)
 Create a new Touch device entry.
TOUCH_DEVICE *STDCALL touch_device_create_ex (uint32_t size)
 Create a new Touch device entry.
uint32_t STDCALL touch_device_destroy (TOUCH_DEVICE *touch)
 Destroy an existing Touch device entry.
uint32_t STDCALL touch_device_register (TOUCH_DEVICE *touch)
 Register a new Touch device in the Touch device table.
uint32_t STDCALL touch_device_deregister (TOUCH_DEVICE *touch)
 Deregister a Touch device from the Touch device table.
TOUCH_DEVICE *STDCALL touch_device_find (uint32_t touchid)
 Find a Touch device by ID in the Touch device table.
TOUCH_DEVICE *STDCALL touch_device_find_by_name (const char *name)
 Find a Touch device by name in the device table.
TOUCH_DEVICE *STDCALL touch_device_find_by_description (const char *description)
 Find a Touch device by description in the device table.
uint32_t STDCALL touch_device_enumerate (touch_enumerate_cb callback, void *data)
 Enumerate all Touch devices in the Touch device table.
uint32_t STDCALL touch_device_notification (TOUCH_DEVICE *touch, touch_notification_cb callback, void *data, uint32_t notification, uint32_t flags)
 Register a notification for Touch device changes.
uint32_t STDCALL touch_get_count (void)
 Get the current Touch device count.
TOUCH_DEVICE *STDCALL touch_device_get_default (void)
 Get the current default Touch device.
uint32_t STDCALL touch_device_set_default (TOUCH_DEVICE *touch)
 Set the current default Touch device.
TOUCH_DEVICE *STDCALL touch_device_check (TOUCH_DEVICE *touch)
 Check if the supplied Touch device is in the Touch device table.
uint32_t STDCALL touch_device_type_to_string (uint32_t touchtype, char *string, uint32_t len)
 Return a string describing the Touch device type (eg TOUCH_TYPE_CAPACITIVE).
uint32_t STDCALL touch_device_state_to_string (uint32_t touchstate, char *string, uint32_t len)
 Return a string describing the Touch device state (eg TOUCH_STATE_ENABLED).
uint32_t STDCALL touch_device_rotation_to_string (uint32_t rotation, char *string, uint32_t len)
 Return a string describing the supplied touch rotation value.
uint32_t STDCALL touch_device_resolve_rotation (uint32_t rotation)
 Resolve a value of 0, 90, 180 or 270 to a touch rotation constant (eg TOUCH_ROTATION_180).
uint32_t STDCALL touch_device_set_callback (TOUCH_DEVICE *touch, touch_event_cb event, void *parameter)
 Set the event callback function for the specified touch device.
uint32_t STDCALL touch_insert_data (TOUCH_DEVICE *touch, TOUCH_DATA *data, BOOL signal)
 Insert a TTouchData entry into the touch device buffer.

Macro Definition Documentation

◆ TOUCH_NAME_PREFIX

#define TOUCH_NAME_PREFIX   "Touch"

Name prefix for Touch Devices.

Touch specific constants

◆ TOUCH_TYPE_NONE

#define TOUCH_TYPE_NONE   0

Touch Device Types

◆ TOUCH_TYPE_RESISTIVE

#define TOUCH_TYPE_RESISTIVE   1

◆ TOUCH_TYPE_CAPACITIVE

#define TOUCH_TYPE_CAPACITIVE   2

◆ TOUCH_TYPE_MAX

#define TOUCH_TYPE_MAX   2

◆ TOUCH_STATE_DISABLED

#define TOUCH_STATE_DISABLED   0

Touch Device States

◆ TOUCH_STATE_ENABLED

#define TOUCH_STATE_ENABLED   1

◆ TOUCH_STATE_MAX

#define TOUCH_STATE_MAX   1

◆ TOUCH_FLAG_NONE

#define TOUCH_FLAG_NONE   0x00000000

Touch Device Flags

◆ TOUCH_FLAG_NON_BLOCK

#define TOUCH_FLAG_NON_BLOCK   0x00000001

If set device reads are non blocking (Also supported in Flags parameter of TouchDeviceRead).

◆ TOUCH_FLAG_PEEK_BUFFER

#define TOUCH_FLAG_PEEK_BUFFER   0x00000002

Peek at the buffer to see if any data is available, don't remove it (Used only in Flags parameter of TouchDeviceRead).

◆ TOUCH_FLAG_MOUSE_DATA

#define TOUCH_FLAG_MOUSE_DATA   0x00000004

If set the device will write a mouse data event for each touch event.

◆ TOUCH_FLAG_MULTI_POINT

#define TOUCH_FLAG_MULTI_POINT   0x00000008

If set the device supports multi point touch.

◆ TOUCH_FLAG_PRESSURE

#define TOUCH_FLAG_PRESSURE   0x00000010

If set the device supports pressure value on touch points.

◆ TOUCH_FLAG_SWAP_XY

#define TOUCH_FLAG_SWAP_XY   0x00000020

If set swap the X and Y coordinates.

◆ TOUCH_FLAG_INVERT_X

#define TOUCH_FLAG_INVERT_X   0x00000040

If set invert the X coordinate.

◆ TOUCH_FLAG_INVERT_Y

#define TOUCH_FLAG_INVERT_Y   0x00000080

If set invert the Y coordinate.

◆ TOUCH_FLAG_SWAP_MAX_XY

#define TOUCH_FLAG_SWAP_MAX_XY   0x00000100

If set swap the maximum X and Y values.

◆ TOUCH_FLAG_RELEASE_TIMER

#define TOUCH_FLAG_RELEASE_TIMER   0x00000200

If set enable the touch release timer for devices that don't provide release events.

◆ TOUCH_FLAG_MASK

◆ TOUCH_CONTROL_GET_FLAG

#define TOUCH_CONTROL_GET_FLAG   1

Get Flag.

Touch Device Control Codes

◆ TOUCH_CONTROL_SET_FLAG

#define TOUCH_CONTROL_SET_FLAG   2

Set Flag.

◆ TOUCH_CONTROL_CLEAR_FLAG

#define TOUCH_CONTROL_CLEAR_FLAG   3

Clear Flag.

◆ TOUCH_CONTROL_FLUSH_BUFFER

#define TOUCH_CONTROL_FLUSH_BUFFER   4

Flush Buffer.

◆ TOUCH_CONTROL_GET_WIDTH

#define TOUCH_CONTROL_GET_WIDTH   5

Get Screen Width.

◆ TOUCH_CONTROL_GET_HEIGHT

#define TOUCH_CONTROL_GET_HEIGHT   6

Get Screen Height.

◆ TOUCH_CONTROL_GET_MAX_X

#define TOUCH_CONTROL_GET_MAX_X   7

Get Maximum X value (Only applies to Absolute X values).

◆ TOUCH_CONTROL_GET_MAX_Y

#define TOUCH_CONTROL_GET_MAX_Y   8

Get Maximum Y value (Only applies to Absolute Y values).

◆ TOUCH_CONTROL_GET_MAX_Z

#define TOUCH_CONTROL_GET_MAX_Z   9

Get Maximum Z value (Only applies to Absolute Z values).

◆ TOUCH_CONTROL_GET_MAX_POINTS

#define TOUCH_CONTROL_GET_MAX_POINTS   10

Get Maximum number of Touch Points.

◆ TOUCH_CONTROL_GET_ROTATION

#define TOUCH_CONTROL_GET_ROTATION   11

Get Rotation value (0, 90, 180, 270)(Only where supported by the driver).

◆ TOUCH_CONTROL_SET_ROTATION

#define TOUCH_CONTROL_SET_ROTATION   12

Set Rotation value (0, 90, 180, 270)(Only where supported by the driver).

◆ TOUCH_CONTROL_GET_CALLBACK

#define TOUCH_CONTROL_GET_CALLBACK   13

Get the registered callback function for touch events.

◆ TOUCH_CONTROL_SET_CALLBACK

#define TOUCH_CONTROL_SET_CALLBACK   14

Set the registered callback function for touch events.

◆ TOUCH_BUFFER_SIZE

#define TOUCH_BUFFER_SIZE   1024

Touch Buffer Size

◆ TOUCH_FINGER

#define TOUCH_FINGER   0x00000001

A finger is pressed at this touch point.

Touch Data Definitions (Values for TTouchData.Info)

◆ TOUCH_ID_UNKNOWN

#define TOUCH_ID_UNKNOWN   (uint16_t)-1

Touch Data Definitions (Values for TTouchData.PointID)

◆ TOUCH_X_UNKNOWN

#define TOUCH_X_UNKNOWN   -1

Touch Data Definitions (Values for TTouchData.PositionX)

◆ TOUCH_Y_UNKNOWN

#define TOUCH_Y_UNKNOWN   -1

Touch Data Definitions (Values for TTouchData.PositionY)

◆ TOUCH_Z_UNKNOWN

#define TOUCH_Z_UNKNOWN   -1

Touch Data Definitions (Values for TTouchData.PositionZ)

◆ TOUCH_ROTATION_0

#define TOUCH_ROTATION_0   FRAMEBUFFER_ROTATION_0

No rotation.

Touch Rotation

◆ TOUCH_ROTATION_90

#define TOUCH_ROTATION_90   FRAMEBUFFER_ROTATION_90

90 degree rotation

◆ TOUCH_ROTATION_180

#define TOUCH_ROTATION_180   FRAMEBUFFER_ROTATION_180

180 degree rotation

◆ TOUCH_ROTATION_270

#define TOUCH_ROTATION_270   FRAMEBUFFER_ROTATION_270

270 degree rotation

Typedef Documentation

◆ TOUCH_DATA

typedef struct _TOUCH_DATA TOUCH_DATA

Touch specific types Touch Data

◆ TOUCH_BUFFER

typedef struct _TOUCH_BUFFER TOUCH_BUFFER

Touch Buffer

◆ TOUCH_PROPERTIES

Touch Properties

◆ TOUCH_DEVICE

typedef struct _TOUCH_DEVICE TOUCH_DEVICE

Touch Device

◆ touch_event_cb

typedef uint32_t STDCALL(* touch_event_cb) (TOUCH_DEVICE *touch, TOUCH_DATA *data)

Touch Event Callback

◆ touch_enumerate_cb

typedef uint32_t STDCALL(* touch_enumerate_cb) (TOUCH_DEVICE *touch, void *data)

Touch Enumeration Callback

◆ touch_notification_cb

typedef uint32_t STDCALL(* touch_notification_cb) (DEVICE *device, void *data, uint32_t notification)

Touch Notification Callback

◆ touch_device_start_proc

typedef uint32_t STDCALL(* touch_device_start_proc) (TOUCH_DEVICE *touch)

Touch Device Methods

◆ touch_device_stop_proc

typedef uint32_t STDCALL(* touch_device_stop_proc) (TOUCH_DEVICE *touch)

◆ touch_device_peek_proc

typedef uint32_t STDCALL(* touch_device_peek_proc) (TOUCH_DEVICE *touch)

◆ touch_device_read_proc

typedef uint32_t STDCALL(* touch_device_read_proc) (TOUCH_DEVICE *touch, void *buffer, uint32_t size, uint32_t flags, uint32_t *count)

◆ touch_device_write_proc

typedef uint32_t STDCALL(* touch_device_write_proc) (TOUCH_DEVICE *touch, void *buffer, uint32_t size, uint32_t count)

◆ touch_device_flush_proc

typedef uint32_t STDCALL(* touch_device_flush_proc) (TOUCH_DEVICE *touch)

◆ touch_device_update_proc

typedef uint32_t STDCALL(* touch_device_update_proc) (TOUCH_DEVICE *touch)

◆ touch_device_control_proc

typedef uint32_t STDCALL(* touch_device_control_proc) (TOUCH_DEVICE *touch, int request, size_t argument1, size_t *argument2)

◆ touch_device_get_properties_proc

typedef uint32_t STDCALL(* touch_device_get_properties_proc) (TOUCH_DEVICE *touch, TOUCH_PROPERTIES *properties)

Function Documentation

◆ touch_device_start()

uint32_t STDCALL touch_device_start ( TOUCH_DEVICE * touch)

Start the specified Touch device ready for receiving events.

Touch Functions

Parameters
TouchThe Touch device to start
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ touch_device_stop()

uint32_t STDCALL touch_device_stop ( TOUCH_DEVICE * touch)

Stop the specified Touch device and terminate receiving events.

Parameters
TouchThe Touch device to stop
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ touch_device_peek()

uint32_t STDCALL touch_device_peek ( TOUCH_DEVICE * touch)

Peek at the buffer of the specified touch device to see if any data packets are ready.

Parameters
TouchThe Touch device to peek at
Returns
ERROR_SUCCESS if packets are ready, ERROR_NO_MORE_ITEMS if not or another error code on failure

◆ touch_device_read()

uint32_t STDCALL touch_device_read ( TOUCH_DEVICE * touch,
void * buffer,
uint32_t size,
uint32_t flags,
uint32_t * count )

Read touch data packets from the buffer of the specified touch device.

Parameters
TouchThe Touch device to read from
BufferPointer to a buffer to copy the touch data packets to
SizeThe size of the buffer in bytes (Must be at least TTouchData or greater)
FlagsThe flags for the behaviour of the read (eg TOUCH_FLAG_NON_BLOCK)
CountThe number of touch data packets copied to the buffer
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ touch_device_write()

uint32_t STDCALL touch_device_write ( TOUCH_DEVICE * touch,
void * buffer,
uint32_t size,
uint32_t count )

Write touch data packets to the buffer of the specified touch device.

Parameters
TouchThe Touch device to write to
BufferPointer to a buffer to copy the touch data packets from
SizeThe size of the buffer in bytes (Must be at least TTouchData or greater)
CountThe number of touch data packets to copy from the buffer
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ touch_device_flush()

uint32_t STDCALL touch_device_flush ( TOUCH_DEVICE * touch)

Flush the contents of the buffer of the specified touch device.

Parameters
TouchThe Touch device to flush
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ touch_device_update()

uint32_t STDCALL touch_device_update ( TOUCH_DEVICE * touch)

Request the specified touch device to update the current configuration.

Parameters
TouchThe Touch device to update
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
Items updated can include rotation, maximum X and Y and flags (If supported)

◆ touch_device_control()

uint32_t STDCALL touch_device_control ( TOUCH_DEVICE * touch,
int request,
size_t argument1,
size_t * argument2 )

Perform a control request on the specified touch device.

Parameters
TouchThe Touch device to control
RequestThe request code for the operation (eg TOUCH_CONTROL_GET_FLAG)
Argument1The first argument for the operation (Dependent on request code)
Argument2The second argument for the operation (Dependent on request code)
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ touch_device_properties()

uint32_t STDCALL touch_device_properties ( TOUCH_DEVICE * touch,
TOUCH_PROPERTIES * properties )

Get the properties for the specified Touch device.

Parameters
TouchThe Touch device to get properties from
PropertiesPointer to a TTouchProperties structure to fill in
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
Replaced by TouchDeviceGetProperties for consistency

◆ touch_device_get_properties()

uint32_t STDCALL touch_device_get_properties ( TOUCH_DEVICE * touch,
TOUCH_PROPERTIES * properties )

Get the properties for the specified Touch device.

Parameters
TouchThe Touch device to get properties from
PropertiesPointer to a TTouchProperties structure to fill in
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ touch_device_create()

TOUCH_DEVICE *STDCALL touch_device_create ( void )

Create a new Touch device entry.

Returns
Pointer to new Touch device entry or nil if Touch device could not be created

◆ touch_device_create_ex()

TOUCH_DEVICE *STDCALL touch_device_create_ex ( uint32_t size)

Create a new Touch device entry.

Parameters
SizeSize in bytes to allocate for new Touch device (Including the Touch device entry)
Returns
Pointer to new Touch device entry or nil if Touch device could not be created

◆ touch_device_destroy()

uint32_t STDCALL touch_device_destroy ( TOUCH_DEVICE * touch)

Destroy an existing Touch device entry.

Parameters
TouchThe Touch device to destroy
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ touch_device_register()

uint32_t STDCALL touch_device_register ( TOUCH_DEVICE * touch)

Register a new Touch device in the Touch device table.

Parameters
TouchThe Touch device to register
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ touch_device_deregister()

uint32_t STDCALL touch_device_deregister ( TOUCH_DEVICE * touch)

Deregister a Touch device from the Touch device table.

Parameters
TouchThe Touch device to deregister
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ touch_device_find()

TOUCH_DEVICE *STDCALL touch_device_find ( uint32_t touchid)

Find a Touch device by ID in the Touch device table.

Parameters
TouchIdThe ID number of the Touch device to find
Returns
Pointer to Touch device entry or nil if not found

◆ touch_device_find_by_name()

TOUCH_DEVICE *STDCALL touch_device_find_by_name ( const char * name)

Find a Touch device by name in the device table.

Parameters
NameThe name of the Touch device to find (eg Touch0)
Returns
Pointer to Touch device entry or nil if not found

◆ touch_device_find_by_description()

TOUCH_DEVICE *STDCALL touch_device_find_by_description ( const char * description)

Find a Touch device by description in the device table.

Parameters
DescriptionThe description of the Touch to find (eg USB Touchscreen)
Returns
Pointer to Touch device entry or nil if not found

◆ touch_device_enumerate()

uint32_t STDCALL touch_device_enumerate ( touch_enumerate_cb callback,
void * data )

Enumerate all Touch devices in the Touch device table.

Parameters
CallbackThe callback function to call for each Touch device in the table
DataA private data pointer to pass to callback for each Touch device in the table
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ touch_device_notification()

uint32_t STDCALL touch_device_notification ( TOUCH_DEVICE * touch,
touch_notification_cb callback,
void * data,
uint32_t notification,
uint32_t flags )

Register a notification for Touch device changes.

Parameters
TouchThe Touch device to notify changes for (Optional, pass nil for all Touch devices)
CallbackThe function to call when a notification event occurs
DataA private data pointer to pass to callback when a notification event occurs
NotificationThe events to register for notification of (eg DEVICE_NOTIFICATION_REGISTER)
FlagsThe flags to control the notification (eg NOTIFIER_FLAG_WORKER)
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ touch_get_count()

uint32_t STDCALL touch_get_count ( void )

Get the current Touch device count.

Touch Helper Functions

Returns
The number of Touch devices

◆ touch_device_get_default()

TOUCH_DEVICE *STDCALL touch_device_get_default ( void )

Get the current default Touch device.

Returns
Pointer to default Touch device entry

◆ touch_device_set_default()

uint32_t STDCALL touch_device_set_default ( TOUCH_DEVICE * touch)

Set the current default Touch device.

Parameters
TouchThe Touch device to set as default
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ touch_device_check()

TOUCH_DEVICE *STDCALL touch_device_check ( TOUCH_DEVICE * touch)

Check if the supplied Touch device is in the Touch device table.

Parameters
TouchThe Touch device to check
Returns
Pointer to Touch device entry or nil if not found

◆ touch_device_type_to_string()

uint32_t STDCALL touch_device_type_to_string ( uint32_t touchtype,
char * string,
uint32_t len )

Return a string describing the Touch device type (eg TOUCH_TYPE_CAPACITIVE).

◆ touch_device_state_to_string()

uint32_t STDCALL touch_device_state_to_string ( uint32_t touchstate,
char * string,
uint32_t len )

Return a string describing the Touch device state (eg TOUCH_STATE_ENABLED).

◆ touch_device_rotation_to_string()

uint32_t STDCALL touch_device_rotation_to_string ( uint32_t rotation,
char * string,
uint32_t len )

Return a string describing the supplied touch rotation value.

◆ touch_device_resolve_rotation()

uint32_t STDCALL touch_device_resolve_rotation ( uint32_t rotation)

Resolve a value of 0, 90, 180 or 270 to a touch rotation constant (eg TOUCH_ROTATION_180).

Note
Also accepts passing the touch rotation constant values directly

◆ touch_device_set_callback()

uint32_t STDCALL touch_device_set_callback ( TOUCH_DEVICE * touch,
touch_event_cb event,
void * parameter )

Set the event callback function for the specified touch device.

Parameters
TouchThe touch device to set the event callback for
EventThe event callback function to be called when touch data is received
ParameterA pointer to private data to be passed to the callback with each event
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
This function also clears the TOUCH_FLAG_MOUSE_DATA flag because the event callback is not compatible with receiving touch events as mouse data

◆ touch_insert_data()

uint32_t STDCALL touch_insert_data ( TOUCH_DEVICE * touch,
TOUCH_DATA * data,
BOOL signal )

Insert a TTouchData entry into the touch device buffer.

Parameters
TouchThe touch device to insert data for
DataThe TTouchData entry to insert
SignalIf True then signal that new data is available in the buffer
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
Caller must hold the touch device lock