Difference between revisions of "Unit Touch"

From Ultibo.org
Jump to: navigation, search
 
(13 intermediate revisions by the same user not shown)
Line 5: Line 5:
 
----
 
----
  
'''Ultibo Touch interface unit'''
+
'''Ultibo Touch Interface unit'''
 
+
''To be documented''
+
  
 
=== Constants ===
 
=== Constants ===
Line 87: 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
 +
|-
 +
| <code>TOUCH_FLAG_RELEASE_TIMER = $00000200;</code>
 +
| If set enable the touch release timer for devices that don't provide release events
 
|-
 
|-
 
|colspan="2"|&nbsp;
 
|colspan="2"|&nbsp;
Line 92: Line 105:
 
|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 or TOUCH_FLAG_RELEASE_TIMER;</code>
 
|-
 
|-
 
|}
 
|}
Line 113: Line 126:
 
| <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)
 +
|-
 +
| <code> TOUCH_CONTROL_GET_CALLBACK = 13;</code>
 +
| Get the registered callback function for touch events
 +
|-
 +
| <code>TOUCH_CONTROL_SET_CALLBACK = 14;</code>
 +
| Set the registered callback function for touch events
 
|-
 
|-
 
|}
 
|}
Line 219: Line 262:
 
|-
 
|-
 
| <code>Info:LongWord;</code>
 
| <code>Info:LongWord;</code>
| style="width: 50%;"|&nbsp;
+
| Bitmap of touch info values (eg TOUCH_FINGER)
 
|-
 
|-
 
| <code>PointID:Word;</code>
 
| <code>PointID:Word;</code>
| &nbsp;
+
| The touch point ID value for this touch (First ID is 1)
 
|-
 
|-
 
| <code>PositionX:SmallInt;</code>
 
| <code>PositionX:SmallInt;</code>
| &nbsp;
+
| The X position of this touch point
 
|-
 
|-
 
| <code>PositionY:SmallInt;</code>
 
| <code>PositionY:SmallInt;</code>
| &nbsp;
+
| The Y position of this touch point
 
|-
 
|-
| <code>PositionZ:SmallInt;</code>
+
| <code>The Z position of this touch point (If applicable)</code>
 
| &nbsp;
 
| &nbsp;
 +
|-
 +
| <code>TouchWidth:Word;</code>
 +
| The Width of this touch point (If applicable)
 +
|-
 +
| <code>TouchHeight:Word;</code>
 +
| The Height of this touch point (If applicable)
 +
|-
 +
| <code>Parameter:Pointer;</code>
 +
| The parameter for the event callback (If applicable)
 
|-
 
|-
 
|}
 
|}
Line 282: Line 334:
 
|-
 
|-
 
| <code>MaxX:LongWord;</code>
 
| <code>MaxX:LongWord;</code>
| Maximum (absolute) X value for the touch device
+
| Maximum (absolute) X position for the touch device
 
|-
 
|-
 
| <code>MaxY:LongWord;</code>
 
| <code>MaxY:LongWord;</code>
| Maximum (absolute) Y value for the touch device
+
| Maximum (absolute) Y position for the touch device
 
|-
 
|-
 
| <code>MaxZ:LongWord;</code>
 
| <code>MaxZ:LongWord;</code>
| Maximum (absolute) Z value for the touch device
+
| Maximum (absolute) Z position for the touch device (If applicable)
 +
|-
 +
| <code>MaxWidth:LongWord;</code>
 +
| Maximum touch width value for the touch device (If applicable)
 +
|-
 +
| <code>MaxHeight:LongWord;</code>
 +
| Maximum touch height value for the touch device (If applicable)
 
|-
 
|-
 
| <code>MaxPoints:LongWord;</code>
 
| <code>MaxPoints:LongWord;</code>
Line 295: Line 353:
 
|}
 
|}
 
</div></div>  
 
</div></div>  
 +
 +
'''Touch event callback'''
 +
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TTouchEvent = function(Touch:PTouchDevice; Data:PTouchData):LongWord;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|} 
  
 
'''Touch enumeration callback'''
 
'''Touch enumeration callback'''
Line 364: Line 431:
 
|-
 
|-
 
| <code>TTouchDeviceFlush = function(Touch:PTouchDevice):LongWord;</code>
 
| <code>TTouchDeviceFlush = function(Touch:PTouchDevice):LongWord;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 +
'''Touch device update'''
 +
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TTouchDeviceUpdate = function(Touch:PTouchDevice):LongWord;</code>
 
| style="width: 40%;"|
 
| style="width: 40%;"|
 
|-
 
|-
Line 372: Line 448:
 
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 
|-
 
|-
| <code>TTouchDeviceControl = function(Touch:PTouchDevice; Request:Integer; Argument1:LongWord; var Argument2:LongWord):LongWord;</code>
+
| <code>TTouchDeviceControl = function(Touch:PTouchDevice; Request:Integer; Argument1:PtrUInt; var Argument2:PtrUInt):LongWord;</code>
 
| style="width: 40%;"|
 
| style="width: 40%;"|
 
|-
 
|-
Line 406: Line 482:
 
|-
 
|-
 
| <code>TouchState:LongWord;</code>
 
| <code>TouchState:LongWord;</code>
| Touch dveice state (eg TOUCH_STATE_ENABLED)
+
| Touch device state (eg TOUCH_STATE_ENABLED)
 
|-
 
|-
 
| <code>DeviceStart:TTouchDeviceStart;</code>
 
| <code>DeviceStart:TTouchDeviceStart;</code>
Line 425: Line 501:
 
| <code>DeviceFlush:TTouchDeviceFlush;</code>
 
| <code>DeviceFlush:TTouchDeviceFlush;</code>
 
| A Device specific DeviceFlush method implementing a standard Touch device interface (Or nil if the default method is suitable)
 
| A Device specific DeviceFlush method implementing a standard Touch device interface (Or nil if the default method is suitable)
 +
|-
 +
| <code>DeviceUpdate:TTouchDeviceUpdate;</code>
 +
| A Device specific DeviceUpdate method implementing a standard Touch device interface (Or nil if the default method is suitable)
 
|-
 
|-
 
| <code>DeviceControl:TTouchDeviceControl;</code>
 
| <code>DeviceControl:TTouchDeviceControl;</code>
Line 436: Line 515:
 
| <code>Lock:TMutexHandle;</code>
 
| <code>Lock:TMutexHandle;</code>
 
| Device lock
 
| Device lock
 +
|-
 +
| <code>Event:TTouchEvent;</code>
 +
| Event callback function (If assigned)
 +
|-
 +
| <code>Parameter:Pointer;</code>
 +
| Parameter for the event callback (or nil)
 
|-
 
|-
 
| <code>Buffer:TTouchBuffer;</code>
 
| <code>Buffer:TTouchBuffer;</code>
Line 619: Line 704:
 
<br />
 
<br />
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">function TouchDeviceControl(Touch:PTouchDevice; Request:Integer; Argument1:LongWord; var Argument2:LongWord):LongWord;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function TouchDeviceUpdate(Touch:PTouchDevice):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Request the specified touch device to update the current configuration</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Touch
 +
| The Touch device to update
 +
|-
 +
! Return
 +
| ERROR_SUCCESS if completed or another error code on failure
 +
|-
 +
! Note
 +
| Items updated can include rotation, maximum X and Y and flags (If supported)
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function TouchDeviceControl(Touch:PTouchDevice; Request:Integer; Argument1:PtrUInt; var Argument2:PtrUInt):LongWord;</pre>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Perform a control request on the specified touch device</div>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Perform a control request on the specified touch device</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
Line 714: Line 817:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! Note
+
! Touch
| None documented
+
| The Touch device to destroy
 +
|-
 +
! Return
 +
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
 
|}
 
|}
Line 726: Line 832:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! Note
+
! Touch
| None documented
+
| The Touch device to register
 +
|-
 +
! Return
 +
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
 
|}
 
|}
Line 734: Line 843:
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<pre style="border: 0; padding-bottom:0px;">function TouchDeviceDeregister(Touch:PTouchDevice):LongWord;</pre>
 
<pre style="border: 0; padding-bottom:0px;">function TouchDeviceDeregister(Touch:PTouchDevice):LongWord;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Deregister an Touch device from the Touch device table</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Deregister a Touch device from the Touch device table</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! Note
+
! Touch
| None documented
+
| The Touch device to dregister
 +
|-
 +
! Return
 +
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
 
|}
 
|}
Line 746: Line 858:
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<pre style="border: 0; padding-bottom:0px;">function TouchDeviceFind(TouchId:LongWord):PTouchDevice;</pre>
 
<pre style="border: 0; padding-bottom:0px;">function TouchDeviceFind(TouchId:LongWord):PTouchDevice;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Find a Touch device by ID in the Touch device table</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! Note
+
! TouchId
| None documented
+
| The ID number of the Touch device to find
 +
|-
 +
! Return
 +
| Pointer to Touch device entry or nil if not found
 
|-
 
|-
 
|}
 
|}
Line 758: Line 873:
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<pre style="border: 0; padding-bottom:0px;">function TouchDeviceFindByName(const Name:String):PTouchDevice; inline;</pre>
 
<pre style="border: 0; padding-bottom:0px;">function TouchDeviceFindByName(const Name:String):PTouchDevice; inline;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Find a Touch device by name in the device table</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! Note
+
! Name
| None documented
+
| The name of the Touch device to find (eg Touch0)
 +
|-
 +
! Return
 +
| Pointer to Touch device entry or nil if not found
 
|-
 
|-
 
|}
 
|}
Line 770: Line 888:
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<pre style="border: 0; padding-bottom:0px;">function TouchDeviceFindByDescription(const Description:String):PTouchDevice; inline;</pre>
 
<pre style="border: 0; padding-bottom:0px;">function TouchDeviceFindByDescription(const Description:String):PTouchDevice; inline;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Find a Touch device by description in the device table</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! Note
+
! Description
| None documented
+
| The description of the Touch to find (eg USB Touchscreen)
 +
|-
 +
! Return
 +
| Pointer to Touch device entry or nil if not found
 
|-
 
|-
 
|}
 
|}
Line 782: Line 903:
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<pre style="border: 0; padding-bottom:0px;">function TouchDeviceEnumerate(Callback:TTouchEnumerate; Data:Pointer):LongWord;</pre>
 
<pre style="border: 0; padding-bottom:0px;">function TouchDeviceEnumerate(Callback:TTouchEnumerate; Data:Pointer):LongWord;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Enumerate all Touch devices in the Touch device table</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! Note
+
! Callback
| None documented
+
| The callback function to call for each Touch device in the table
 +
|-
 +
! Data
 +
| A private data pointer to pass to callback for each Touch device in the table
 +
|-
 +
! Return
 +
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
 
|}
 
|}
Line 794: Line 921:
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<pre style="border: 0; padding-bottom:0px;">function TouchDeviceNotification(Touch:PTouchDevice; Callback:TTouchNotification; Data:Pointer; Notification,Flags:LongWord):LongWord;</pre>
 
<pre style="border: 0; padding-bottom:0px;">function TouchDeviceNotification(Touch:PTouchDevice; Callback:TTouchNotification; Data:Pointer; Notification,Flags:LongWord):LongWord;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Register a notification for Touch device changes</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! Note
+
! Touch
| None documented
+
| The Touch device to notify changes for (Optional, pass nil for all Touch devices)
 +
|-
 +
! Callback
 +
| The function to call when a notification event occurs
 +
|-
 +
! Data
 +
| A private data pointer to pass to callback when a notification event occurs
 +
|-
 +
! Notification
 +
| The events to register for notification of (eg DEVICE_NOTIFICATION_REGISTER)
 +
|-
 +
! Flags
 +
| The flags to control the notification (eg NOTIFIER_FLAG_WORKER)
 +
|-
 +
! Return
 +
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
 
|}
 
|}
Line 808: Line 950:
  
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">function TouchGetCount:LongWord; inline;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function TouchGetCount:LongWord;</pre>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current Touch device count</div>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current Touch device count</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! Note
+
! Return
| None documented
+
| The number of Touch devices
 
|-
 
|-
 
|}
 
|}
Line 820: Line 962:
 
<br />
 
<br />
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">function TouchDeviceGetDefault:PTouchDevice; inline;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function TouchDeviceGetDefault:PTouchDevice;</pre>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current default Touch device</div>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current default Touch device</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! Note
+
! Return
| None documented
+
| Pointer to default Touch device entry
 
|-
 
|-
 
|}
 
|}
Line 837: Line 979:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! Note
+
! Touch
| None documented
+
| The Touch device to set as default
 +
|-
 +
! Return
 +
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
 
|}
 
|}
Line 849: Line 994:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! Note
+
! Touch
| None documented
+
| The Touch device to check
 +
|-
 +
! Return
 +
| Pointer to Touch device entry or nil if not found
 
|-
 
|-
 
|}
 
|}
Line 857: Line 1,005:
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<pre style="border: 0; padding-bottom:0px;">function TouchDeviceTypeToString(TouchType:LongWord):String;</pre>
 
<pre style="border: 0; padding-bottom:0px;">function TouchDeviceTypeToString(TouchType:LongWord):String;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Return a string describing the Touch device type (eg TOUCH_TYPE_CAPACITIVE)</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
Line 869: Line 1,017:
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<pre style="border: 0; padding-bottom:0px;">function TouchDeviceStateToString(TouchState:LongWord):String;</pre>
 
<pre style="border: 0; padding-bottom:0px;">function TouchDeviceStateToString(TouchState:LongWord):String;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Return a string describing the Touch device state (eg TOUCH_STATE_ENABLED)</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
Line 875: Line 1,023:
 
! Note
 
! Note
 
| None documented
 
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function TouchDeviceRotationToString(Rotation:LongWord):String;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Return a string describing the supplied touch rotation value</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function TouchDeviceResolveRotation(ARotation:LongWord):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Resolve a value of 0, 90, 180 or 270 to a touch rotation constant (eg TOUCH_ROTATION_180)</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Also accepts passing the touch rotation constant values directly
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function TouchDeviceSetCallback(Touch:PTouchDevice; Event:TTouchEvent; Parameter:Pointer):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the event callback function for the specified touch device</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Touch
 +
| The touch device to set the event callback for
 +
|-
 +
! Event
 +
| The event callback function to be called when touch data is received
 +
|-
 +
! Parameter
 +
| A pointer to private data to be passed to the callback with each event
 +
|-
 +
! Return
 +
| 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
 
|-
 
|-
 
|}
 
|}

Latest revision as of 00:32, 14 June 2024

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 event callback

TTouchEvent = function(Touch:PTouchDevice; Data:PTouchData):LongWord;

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 update

TTouchDeviceUpdate = function(Touch:PTouchDevice):LongWord;

Touch device control

TTouchDeviceControl = function(Touch:PTouchDevice; Request:Integer; Argument1:PtrUInt; var Argument2:PtrUInt):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 TouchDeviceUpdate(Touch:PTouchDevice):LongWord;
Description: Request the specified touch device to update the current configuration


[Expand]
function TouchDeviceControl(Touch:PTouchDevice; Request:Integer; Argument1:PtrUInt; var Argument2:PtrUInt):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 a Touch device from the Touch device table


[Expand]
function TouchDeviceFind(TouchId:LongWord):PTouchDevice;
Description: Find a Touch device by ID in the Touch device table


[Expand]
function TouchDeviceFindByName(const Name:String):PTouchDevice; inline;
Description: Find a Touch device by name in the device table


[Expand]
function TouchDeviceFindByDescription(const Description:String):PTouchDevice; inline;
Description: Find a Touch device by description in the device table


[Expand]
function TouchDeviceEnumerate(Callback:TTouchEnumerate; Data:Pointer):LongWord;
Description: Enumerate all Touch devices in the Touch device table


[Expand]
function TouchDeviceNotification(Touch:PTouchDevice; Callback:TTouchNotification; Data:Pointer; Notification,Flags:LongWord):LongWord;
Description: Register a notification for Touch device changes


Touch helper functions

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


[Expand]
function TouchDeviceGetDefault:PTouchDevice;
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: Return a string describing the Touch device type (eg TOUCH_TYPE_CAPACITIVE)


[Expand]
function TouchDeviceStateToString(TouchState:LongWord):String;
Description: Return a string describing the Touch device state (eg TOUCH_STATE_ENABLED)


[Expand]
function TouchDeviceRotationToString(Rotation:LongWord):String;
Description: Return a string describing the supplied touch rotation value


[Expand]
function TouchDeviceResolveRotation(ARotation:LongWord):LongWord;
Description: Resolve a value of 0, 90, 180 or 270 to a touch rotation constant (eg TOUCH_ROTATION_180)


[Expand]
function TouchDeviceSetCallback(Touch:PTouchDevice; Event:TTouchEvent; Parameter:Pointer):LongWord;
Description: Set the event callback function for the specified touch device


[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