Difference between revisions of "Unit Touch"

From Ultibo.org
Jump to: navigation, search
Line 85: Line 85:
 
| <code>TOUCH_FLAG_PRESSURE = $00000010;</code>
 
| <code>TOUCH_FLAG_PRESSURE = $00000010;</code>
 
| If set the device supports pressure value on touch points
 
| If set the device supports pressure value on touch points
 +
|-
 +
| <code>TOUCH_FLAG_SWAP_XY = $00000020;</code>
 +
| If set swap the X and Y coordinates
 +
|-
 +
| <code>TOUCH_FLAG_INVERT_X = $00000040;</code>
 +
| If set invert the X coordinate
 +
|-
 +
| <code>TOUCH_FLAG_INVERT_Y = $00000080;</code>
 +
| If set invert the Y coordinate
 +
|-
 +
| <code>TOUCH_FLAG_SWAP_MAX_XY = $00000100;</code>
 +
| If set swap the maximum X and Y values
 
|-
 
|-
 
|colspan="2"|&nbsp;
 
|colspan="2"|&nbsp;
Line 90: Line 102:
 
|colspan="2"|''Flags supported by TOUCH_CONTROL_GET/SET/CLEAR_FLAG''
 
|colspan="2"|''Flags supported by TOUCH_CONTROL_GET/SET/CLEAR_FLAG''
 
|-
 
|-
|colspan="2"|<code>TOUCH_FLAG_MASK = TOUCH_FLAG_NON_BLOCK or TOUCH_FLAG_MOUSE_DATA or TOUCH_FLAG_MULTI_POINT or TOUCH_FLAG_PRESSURE;</code>
+
|colspan="2"|<code>TOUCH_FLAG_MASK = TOUCH_FLAG_NON_BLOCK or TOUCH_FLAG_MOUSE_DATA or TOUCH_FLAG_MULTI_POINT or TOUCH_FLAG_PRESSURE or TOUCH_FLAG_SWAP_XY or TOUCH_FLAG_INVERT_X or TOUCH_FLAG_INVERT_Y or TOUCH_FLAG_SWAP_MAX_XY;</code>
 
|-
 
|-
 
|}
 
|}
Line 111: Line 123:
 
| <code>TOUCH_CONTROL_FLUSH_BUFFER = 4;</code>
 
| <code>TOUCH_CONTROL_FLUSH_BUFFER = 4;</code>
 
| Flush Buffer
 
| Flush Buffer
 +
|-
 +
| <code>TOUCH_CONTROL_GET_WIDTH = 5;</code>
 +
| Get Screen Width
 +
|-
 +
| <code>TOUCH_CONTROL_GET_HEIGHT = 6;</code>
 +
| Get Screen Height
 +
|-
 +
| <code>TOUCH_CONTROL_GET_MAX_X = 7;</code>
 +
| Get Maximum X value (Only applies to Absolute X values)
 +
|-
 +
| <code>TOUCH_CONTROL_GET_MAX_Y = 8;</code>
 +
| Get Maximum Y value (Only applies to Absolute Y values)
 +
|-
 +
| <code>TOUCH_CONTROL_GET_MAX_Z = 9;</code>
 +
| Get Maximum Z value (Only applies to Absolute Z values)
 +
|-
 +
| <code>TOUCH_CONTROL_GET_MAX_POINTS = 10;</code>
 +
| Get Maximum number of Touch Points
 +
|-
 +
| <code>TOUCH_CONTROL_GET_ROTATION = 11;</code>
 +
| Get Rotation value (0, 90, 180, 270)(Only where supported by the driver)
 +
|-
 +
| <code>TOUCH_CONTROL_SET_ROTATION = 12;</code>
 +
| Set Rotation value (0, 90, 180, 270)(Only where supported by the driver)
 
|-
 
|-
 
|}
 
|}

Revision as of 05:16, 3 August 2022

Return to Unit Reference


Description


Ultibo Touch Interface unit

Constants



[Expand]
Touch specific constants TOUCH_*


[Expand]
Touch device type TOUCH_TYPE_*


[Expand]
Touch device state TOUCH_STATE_*


[Expand]
Touch device flag TOUCH_FLAG_*


[Expand]
Touch device control code TOUCH_CONTROL_*


[Expand]
Touch buffer size TOUCH_BUFFER_*


[Expand]
Touch data definitions TOUCH_FINGER*, TOUCH_ID_*


[Expand]
Touch rotation TOUCH_ROTATION_*


[Expand]
Touch logging TOUCH_LOG_*


Type definitions



Touch data

[Expand]

PTouchData = ^TTouchData;

TTouchData = record

Touch buffer

[Expand]

PTouchBuffer = ^TTouchBuffer;

TTouchBuffer = record

Touch properties

[Expand]

PTouchProperties = ^TTouchProperties;

TTouchProperties = record

Touch enumeration callback

TTouchEnumerate = function(Touch:PTouchDevice; Data:Pointer):LongWord;

Touch notification callback

TTouchNotification = function(Device:PDevice; Data:Pointer; Notification:LongWord):LongWord;

Touch device start

TTouchDeviceStart = function(Touch:PTouchDevice):LongWord;

Touch device stop

TTouchDeviceStop = function(Touch:PTouchDevice):LongWord;

Touch device peek

TTouchDevicePeek = function(Touch:PTouchDevice):LongWord;

Touch device read

TTouchDeviceRead = function(Touch:PTouchDevice; Buffer:Pointer; Size,Flags:LongWord; var Count:LongWord):LongWord;

Touch device write

TTouchDeviceWrite = function(Touch:PTouchDevice; Buffer:Pointer; Size,Count:LongWord):LongWord;

Touch device flush

TTouchDeviceFlush = function(Touch:PTouchDevice):LongWord;

Touch device control

TTouchDeviceControl = function(Touch:PTouchDevice; Request:Integer; Argument1:LongWord; var Argument2:LongWord):LongWord;

Touch device get properties

TTouchDeviceGetProperties = function(Touch:PTouchDevice; Properties:PTouchProperties):LongWord;

Touch device

[Expand]

PTouchDevice = ^TTouchDevice;

TTouchDevice = record


Public variables



Touch logging

TOUCH_DEFAULT_LOG_LEVEL:LongWord = TOUCH_LOG_LEVEL_DEBUG; Minimum level for Touch messages. Only messages with level greater than or equal to this will be printed.
TOUCH_LOG_ENABLED:Boolean;


Function declarations



Initialization functions

[Expand]
procedure TouchInit;
Description: Initialize the Touch unit and Touch device table


Touch functions

[Expand]
function TouchDeviceStart(Touch:PTouchDevice):LongWord;
Description: Start the specified Touch device ready for receiving events


[Expand]
function TouchDeviceStop(Touch:PTouchDevice):LongWord;
Description: Stop the specified Touch device and terminate receiving events


[Expand]
function TouchDevicePeek(Touch:PTouchDevice):LongWord;
Description: Peek at the buffer of the specified touch device to see if any data packets are ready


[Expand]
function TouchDeviceRead(Touch:PTouchDevice; Buffer:Pointer; Size,Flags:LongWord; var Count:LongWord):LongWord;
Description: Read touch data packets from the buffer of the specified touch device


[Expand]
function TouchDeviceWrite(Touch:PTouchDevice; Buffer:Pointer; Size,Count:LongWord):LongWord;
Description: Write touch data packets to the buffer of the specified touch device


[Expand]
function TouchDeviceFlush(Touch:PTouchDevice):LongWord;
Description: Flush the contents of the buffer of the specified touch device


[Expand]
function TouchDeviceControl(Touch:PTouchDevice; Request:Integer; Argument1:LongWord; var Argument2:LongWord):LongWord;
Description: Perform a control request on the specified touch device


[Expand]
function TouchDeviceProperties(Touch:PTouchDevice; Properties:PTouchProperties):LongWord; inline;
Description: Get the properties for the specified Touch device


[Expand]
function TouchDeviceGetProperties(Touch:PTouchDevice;Properties:PTouchProperties):LongWord;
Description: Get the properties for the specified Touch device


[Expand]
function TouchDeviceCreate:PTouchDevice;
Description: Create a new Touch device entry


[Expand]
function TouchDeviceCreateEx(Size:LongWord):PTouchDevice;
Description: Create a new Touch device entry


[Expand]
function TouchDeviceDestroy(Touch:PTouchDevice):LongWord;
Description: Destroy an existing Touch device entry


[Expand]
function TouchDeviceRegister(Touch:PTouchDevice):LongWord;
Description: Register a new Touch device in the Touch device table


[Expand]
function TouchDeviceDeregister(Touch:PTouchDevice):LongWord;
Description: Deregister an Touch device from the Touch device table


[Expand]
function TouchDeviceFind(TouchId:LongWord):PTouchDevice;
Description: To be documented


[Expand]
function TouchDeviceFindByName(const Name:String):PTouchDevice; inline;
Description: To be documented


[Expand]
function TouchDeviceFindByDescription(const Description:String):PTouchDevice; inline;
Description: To be documented


[Expand]
function TouchDeviceEnumerate(Callback:TTouchEnumerate; Data:Pointer):LongWord;
Description: To be documented


[Expand]
function TouchDeviceNotification(Touch:PTouchDevice; Callback:TTouchNotification; Data:Pointer; Notification,Flags:LongWord):LongWord;
Description: To be documented


Touch helper functions

[Expand]
function TouchGetCount:LongWord; inline;
Description: Get the current Touch device count


[Expand]
function TouchDeviceGetDefault:PTouchDevice; inline;
Description: Get the current default Touch device


[Expand]
function TouchDeviceSetDefault(Touch:PTouchDevice):LongWord;
Description: Set the current default Touch device


[Expand]
function TouchDeviceCheck(Touch:PTouchDevice):PTouchDevice;
Description: Check if the supplied Touch device is in the Touch device table


[Expand]
function TouchDeviceTypeToString(TouchType:LongWord):String;
Description: To be documented


[Expand]
function TouchDeviceStateToString(TouchState:LongWord):String;
Description: To be documented


[Expand]
function TouchInsertData(Touch:PTouchDevice; Data:PTouchData; Signal:Boolean):LongWord;
Description: Insert a TTouchData entry into the touch device buffer


[Expand]
procedure TouchLog(Level:LongWord; Touch:PTouchDevice; const AText:String);
Description: To be documented


[Expand]
procedure TouchLogInfo(Touch:PTouchDevice; const AText:String); inline;
Description: To be documented


[Expand]
procedure TouchLogWarn(Touch:PTouchDevice; const AText:String); inline;
Description: To be documented


[Expand]
procedure TouchLogError(Touch:PTouchDevice; const AText:String); inline;
Description: To be documented


[Expand]
procedure TouchLogDebug(Touch:PTouchDevice; const AText:String); inline;
Description: To be documented


Return to Unit Reference