Difference between revisions of "Unit Touch"

From Ultibo.org
Jump to: navigation, search
Line 10: Line 10:
 
----
 
----
  
''To be documented''
+
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''Touch specific constants''' <code> TOUCH_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>TOUCH_NAME_PREFIX = 'Touch';</code>
 +
| Name prefix for Touch Devices
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''Touch device type constants''' <code> TOUCH_TYPE_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>TOUCH_TYPE_NONE = 0;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>TOUCH_TYPE_RESISTIVE = 1;</code>
 +
| &nbsp;
 +
|-
 +
| <code>TOUCH_TYPE_CAPACITIVE = 2;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''Touch device state constants''' <code> TOUCH_STATE_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>TOUCH_STATE_DISABLED = 0;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>TOUCH_STATE_ENABLED = 1;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''Touch device flag constants''' <code> TOUCH_FLAG_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>TOUCH_FLAG_NONE = $00000000;</code>
 +
| &nbsp;
 +
|-
 +
| <code>TOUCH_FLAG_NON_BLOCK = $00000001;</code>
 +
| If set device reads are non blocking (Also supported in Flags parameter of TouchDeviceRead)
 +
|-
 +
| <code>TOUCH_FLAG_PEEK_BUFFER = $00000002;</code>
 +
| Peek at the buffer to see if any data is available, don't remove it (Used only in Flags parameter of TouchDeviceRead)
 +
|-
 +
| <code>TOUCH_FLAG_MOUSE_DATA = $00000004;</code>
 +
| If set the device will write a mouse data event for each touch event
 +
|-
 +
| <code>TOUCH_FLAG_MULTI_POINT = $00000008;</code>
 +
| If set the device supports multi point touch
 +
|-
 +
| <code>TOUCH_FLAG_PRESSURE = $00000010;</code>
 +
| If set the device supports pressure value on touch points
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|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>
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''Touch device control code constants''' <code> TOUCH_CONTROL_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>TOUCH_CONTROL_GET_FLAG = 1;</code>
 +
| Get Flag
 +
|-
 +
| <code>TOUCH_CONTROL_SET_FLAG = 2;</code>
 +
| Set Flag
 +
|-
 +
| <code>TOUCH_CONTROL_CLEAR_FLAG = 3;</code>
 +
| Clear Flag
 +
|-
 +
| <code>TOUCH_CONTROL_FLUSH_BUFFER = 4;</code>
 +
| Flush Buffer
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''Touch buffer size constants''' <code> TOUCH_BUFFER_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>TOUCH_BUFFER_SIZE = 1024;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''Touch data definitions constants''' <code> TOUCH_FINGER*, TOUCH_ID_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|''Values for TTouchData.Info''
 +
|-
 +
| <code>TOUCH_FINGER = $00000001;</code>
 +
| A finger is pressed at this touch point
 +
|-
 +
|colspan="2"|''Values for TTouchData.PointID''
 +
|-
 +
| <code>TOUCH_ID_UNKNOWN = Word(-1);</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|''Values for TTouchData.PositionX''
 +
|-
 +
| <code>TOUCH_X_UNKNOWN = -1;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|''Values for TTouchData.PositionY''
 +
|-
 +
| <code>TOUCH_Y_UNKNOWN = -1;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|''Values for TTouchData.PositionZ''
 +
|-
 +
| <code>TOUCH_Z_UNKNOWN = -1;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''Touch rotation constants''' <code> TOUCH_ROTATION_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>TOUCH_ROTATION_0 = FRAMEBUFFER_ROTATION_0;</code>
 +
| No rotation
 +
|-
 +
| <code>TOUCH_ROTATION_90 = FRAMEBUFFER_ROTATION_90;</code>
 +
| 90 degree rotation
 +
|-
 +
| <code>TOUCH_ROTATION_180 = FRAMEBUFFER_ROTATION_180;</code>
 +
| 180 degree rotation
 +
|-
 +
| <code>TOUCH_ROTATION_270 = FRAMEBUFFER_ROTATION_270;</code>
 +
| 270 degree rotation
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''Touch logging constants''' <code> TOUCH_LOG_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>TOUCH_LOG_LEVEL_DEBUG = LOG_LEVEL_DEBUG;</code>
 +
| Touch debugging messages
 +
|-
 +
| <code>TOUCH_LOG_LEVEL_INFO = LOG_LEVEL_INFO;</code>
 +
| Touch informational messages, such as a device being attached or detached
 +
|-
 +
| <code>TOUCH_LOG_LEVEL_ERROR = LOG_LEVEL_ERROR;</code>
 +
| Touch error messages
 +
|-
 +
| <code>TOUCH_LOG_LEVEL_NONE = LOG_LEVEL_NONE;</code>
 +
| No Touch messages
 +
|-
 +
|}
 +
</div></div>
 +
<br />
  
 
=== Type definitions ===
 
=== Type definitions ===

Revision as of 03:22, 29 November 2016

Return to Unit Reference


Description


To be documented

Constants



[Expand]
Touch specific constants TOUCH_*


[Expand]
Touch device type constants TOUCH_TYPE_*


[Expand]
Touch device state constants TOUCH_STATE_*


[Expand]
Touch device flag constants TOUCH_FLAG_*


[Expand]
Touch device control code constants TOUCH_CONTROL_*


[Expand]
Touch buffer size constants TOUCH_BUFFER_*


[Expand]
Touch data definitions constants TOUCH_FINGER*, TOUCH_ID_*


[Expand]
Touch rotation constants TOUCH_ROTATION_*


[Expand]
Touch logging constants TOUCH_LOG_*


Type definitions


To be documented

Public variables


To be documented

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;
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]
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 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