Skip to main content

Reference

Overview

This document describes the Wacom Feel™ Multi-Touch application programmers interface. This API allows an application to get low level touch data from a Wacom multi-touch device. While the API library is included with the Wacom tablet driver, not all devices support multi-touch. The low level data provided by this API is finger point data, blob region data, and/or raw sensor data. Some devices may not support all data types.

Data Types

WacomMTError

Error conditions used as a return value for all functions.

typedef enum _WacomMTError
{
WMTErrorSuccess = 0,
WMTErrorDriverNotFound = 1,
WMTErrorBadVersion = 2,
WMTErrorAPIOutdated = 3,
WMTErrorInvalidParam = 4,
WMTErrorQuit = 5,
WMTErrorBufferTooSmall = 6
} WacomMTError;
FieldDefinition
WMTErrorSuccessReturned when a call is successful.
WMTErrorDriverNotFoundReturned when the API does not find an installed and running driver.
WMTErrorBadVersionReturned when the version of the driver is not compatible with the API. This will happen when an application requests newer API data structures that are not supported by the driver.
WMTErrorAPIOutdatedReturned when an application requests API data structures that are no longer supported by the driver.
WMTErrorInvalidParamReturned when one or more parameters are invalid.
WMTErrorQuitReturned by wait functions when the API quit call is made or if the API has not been successfully initialized.
WMTErrorBufferTooSmallReturned if the supplied buffer is to small.

WacomMTDeviceType

Type of sensor device. Used in the capabilities data structure.

{
WMTDeviceTypeOpaque = 0,
WMTDeviceTypeIntegrated = 1
} WacomMTDeviceType;
FieldDefinition
WMTDeviceTypeOpaqueThe touch sensor is not integrated with a display. Opaque trackpad like devices return this value.
WMTDeviceTypeIntegratedThe touch sensor is integrated with a display. Screen touch devices, such as TabletPCs return this value.

WacomMTCapabilityFlags

Used in the capabilities structure to indicate the type of data supported by the device.

enum _WacomMTCapabilityFlags
{
WMTCapabilityFlagsRawAvailable = (1 << 0),
WMTCapabilityFlagsBlobAvailable = (1 << 1),
WMTCapabilityFlagsSensitivityAvailable = (1 << 2),
WMTCapabilityFlagsReserved = (1 << 31)
};
typedef int WacomMTCapabilityFlags;
FieldDefinition
WMTCapabilityFlagsRawAvailable

If this flag is set, the device supports raw data and raw data can be read.

WMTCapabilityFlagsBlobAvailable

If this flag is set, the device supports blob data and blob data can be read.

WMTCapabilityFlagsSensitivityAvailable If this flag is set, sensitivity data will be available in the finger data. Sensitivity data is a value between 0 and 0xFFFF. If this flag is not set, sensitivity data will be set to zero in each up packet and max for the down/hold packets. See the WacomMTFinger data structure for a definition of sensitivity.

WacomMTCapability

This structure contains the physical and logical capabilities of a multi-touch device.

typedef struct _WacomMTCapability
{
int Version;
int DeviceID;
WacomMTDeviceType Type;
float LogicalOriginX;
float LogicalOriginY;
float LogicalWidth;
float LogicalHeight;
float PhysicalSizeX;
float PhysicalSizeY;
int ReportedSizeX;
int ReportedSizeY;
int ScanSizeX;
int ScanSizeY;
int FingerMax;
int BlobMax;
int BlobPointsMax;
WacomMTCapabilityFlags CapabilityFlags;
} WacomMTCapability;
Field Definition
Version The version of this data structure.
DeviceID

A value that identifies a touch device. This is a unique number that may vary from machine to machine and session to session, but will be the same during any given session. This value is used with all other calls to identify the device.

Type

A value that indicates the device type. An opaque device does not have a fixed relationship with the screen. An integrated device has a one-to-one relationship to a single monitor.

LogicalOriginX

Minimum horizontal value of the device reported after interpolation. For an opaque device this value will be zero. For integrated devices this value is the (upper) left point in pixels of the mapped monitor in relation to the entire desktop. This may map to an adjacent monitor if the touch device is larger than the integrated display.

LogicalOriginY

Minimum vertical value of the device reported after interpolation. For an opaque device this value will be zero. For integrated devices this value is the upper (left) point in pixels of the mapped monitor in relation to the entire desktop. This may map to an adjacent monitor if the touch device is larger than the integrated display.

LogicalWidth

Width of the device reported after interpolation. For an opaque device this value is 1 and is unit neutral. For integrated devices this value is the number of pixels the device covers. This may map to an adjacent display if the touch device is larger than the integrated display.

LogicalHeight

Height of the device reported after interpolation. For an opaque device this value is 1 and is unit neutral. For integrated devices this value is the number of pixels the device covers. This may map to an adjacent display if the touch device is larger than the integrated display.

PhysicalSizeX

Width of the sensing area of the device in mm. Used with other size factors to convert the device data from one coordinate system to another.

PhysicalSizeY

Height of the sensing area of the device in mm. Used with other size factors to convert the device data from one coordinate system to another.

ReportedSizeX

Width of the device in native counts. Used with other size factors to determine the maximum resolution of the data. The horizontal resolution is calculated by dividing this value by PhysicalSizeX.

ReportedSizeY

Height of the device in native counts. Used with other size factors to determine the maximum resolution of the data. The vertical resolution is calculated by dividing this value by PhysicalSizeY.

ScanSizeX

Width of the device in scan coils. This is only provided for devices that support raw data. This value is used to calculate the size of the raw data buffer. (ScanSizeX

  • ScanSizeY) If the device does not support raw data this value should be ignored.
ScanSizeY

Height of the device in scan coils. This is only provided for devices that support raw data. This value is used to calculate the size of the raw data buffer. (ScanSizeX

  • ScanSizeY) If the device does not support raw data this value should be ignored.
FingerMax

Maximum number of fingers that are supported. This is the number of fingers this device can report as down at any given time. This can be used to help calculate the maximum size of the finger collection structure. This is not the maximum value for FingerID.

BlobMax

Maximum number of blobs in a blob aggregate. A blob is a series of points that define its outline. A blob can be a primary blob or a void blob. Each void blob has one and only one parent while a primary blob can have zero or more child blobs which define void areas within the parent blob. For example, a doughnut shape is a blob aggregate with the outer ring being the parent blob and the inner ring being a child blob.

BlobPointsMax

Maximum number of blob points that make up a blob. These blob values (BlobMax and BlobPointsMax) can be used to calculate the maximum size of a blob aggregate. (BlobMax * BlobPointsMax)

CapabilityFlags A value to indicate the presence of specific data elements. See the WacomMTCapabilityFlags enumeration definition.

WacomMTFingerState

Used in the finger structure to indicate the state of the finger.

typedef enum _WacomMTFingerState
{
WMTFingerStateNone = 0,
WMTFingerStateDown = 1,
WMTFingerStateHold = 2,
WMTFingerStateUp = 3
} WacomMTFingerState;
FieldDefinition
WMTFingerStateNoneA finger buffer may contain room for more than one contact. Any extra unused contact is set to "None". Once a contact has passed through the "Up" state it has the TouchState set to "None" to indicate that no further processing is needed. Any other data included with this state is not valid.
WMTFingerStateDownIndicates initial finger contact. It is sent with the first touch packet for a particular contact.
WMTFingerStateHoldSubsequent packets during the finger contact.
WMTFingerStateUpLast touch packet for a particular finger contact. Reported when the finger is lifted. This will be reported at the last known valid position.

WacomMTFinger

This structure contains the data for individual touch contacts.

typedef struct _WacomMTFinger
{
int FingerID;
float X;
float Y;
float Width;
float Height;
unsigned short Sensitivity;
float Orientation;
bool Confidence;
WacomMTFingerState TouchState;
} WacomMTFinger;
FieldDefinition
FingerIDUnique identifier of the contact. This value starts with 1 for the first contact and increments for each subsequent contact. This value resets to 1 when all contacts are lifted up. This is to be used to track contacts from frame to frame. This does not represent a unique value for a specific finger, but is unique for the contact and represents the same contact point for the duration of the contact.
XScaled X of the contact area in logical units.
YScaled Y of the contact area in logical units.
WidthWidth of the contact area in logical units.
HeightHeight of the contact area in logical units.
SensitivityStrength of the contact. This is not pressure. This is a device/user specific indication of the strength of the contact point. Only valid in relation to other fingers within the same frame/gesture.
OrientationThe orientation of the contact point in degrees.
ConfidenceIf true the driver believes this is a valid touch from a finger. If false the driver thinks this may be an accidental touch, forearm, or palm.
TouchStateThe state of this finger contact. See the WacomMTFingerState enumeration definition.

WacomMTFingerCollection

This structure allows for a list of fingers.

typedef struct _WacomMTFingerCollection
{
int Version;
int DeviceID;
int FrameNumber;
int FingerCount;
WacomMTFinger *Fingers;
} WacomMTFingerCollection;
FieldDefinition
VersionThe version of this data structure.
DeviceIDA value that identifies a touch device. This is a unique number that may vary from machine to machine and session to session, but will be the same during any given session.
FingerCountThe number of elements in the finger data array. This value will vary from frame to frame but will never be greater than the FingerMax value for the specific device.
FingerDataPointer to an array of fingers. The size of the FingerData block is FingerCount * sizeof(WacomMTFinger).

WacomMTBlobType

Used by the blob structure to identify the blob type.

typedef enum _WacomMTBlobType
{
WMTBlobTypePrimary = 0,
WMTBlobTypeVoid = 1
} WacomMTBlobType;
FieldDefinition
WMTBlobTypePrimaryThis is an outline of an outer primary blob.
WMTBlobTypeVoidThis is an outline of an inner blob that is contained within an outer primary blob. Void blobs are regions of no touch within primary blobs. A primary blob may contain one or more void blobs. Void blobs do not contain other blobs. A unique primary blob can be within another blob's void but the void does not reference that blob.

WacomMTBlobPoint

This structure contains information about a specific point of blob data.

typedef struct _WacomMTBlobPoint
{
float X;
float Y;
unsigned short Sensitivity;
} WacomMTBlobPoint;
FieldDefinition
XScaled X value of a blob point in logical units.
YScaled Y value of a blob point in logical units.
SensitivityStrength of the signal at this blob point. This is not pressure. This is a device/user specific indication of the strength of the contact point. Only valid in relation to other blobs within the same frame.

WacomMTBlob

This structure contains the contact data for an irregular region.

typedef struct _WacomMTBlob
{
int BlobID;
float X;
float Y;
bool Confidence;
WacomMTBlobType BlobType;
int ParentID;
int PointCount;
WacomMTBlobPoint *BlobPoints;
} WacomMTBlob;
Field Definition
BlobID

This is a value that uniquely identifies this blob. This value persists from frame to frame.

X Scaled X center of gravity of the blob area in logical units.
Y Scaled Y center of gravity of the blob area in logical units.
Confidence

If true, the driver believes this is a valid touch. If false, the driver thinks this may be an accidental touch, forearm, or palm.

BlobType

The blob type this structure represents. See the WacomMTBlobType enumeration definition.

ParentID

This identifies the parent blob. Valid only if the BlobType is "Void".

PointCount

The number of elements in the blob points array. This is the number of points that make up the outline of the blob.

BlobPoints Pointer to an array of blob points. The size of the BlobPoints block is PointCount * sizeof(WacomMTBlobPoint). The blob points form a closed area.

WacomMTBlobAggregate

This structure allows for a list of blobs.

typedef struct _WacomMTBlobAggregate
{
int Version;
int DeviceID;
int FrameNumber;
int BlobCount;
WacomMTBlob *BlobArray;
} WacomMTBlobAggregate;
FieldDefinition
VersionThe version of this data structure.
DeviceIDA value that identifies a touch device. This is a unique number that may vary from machine to machine and session to session, but will be the same during any given session.
FrameNumberThis value is incremented every time a new packet of contacts is detected.
BlobCountNumber of elements in the blob data array.
BlobArrayAn array of blobs. The size of the BlobArray block is BlobCount * sizeof(WacomMTBlob).

WacomMTRawData

This structure represents the strength values for the surface of the device.

typedef struct _WacomMTRawData
{
int Version;
int DeviceID;
int FrameNumber;
int ElementCount;
unsigned short *Sensitivity;
} WacomMTRawData;
FieldDefinition
VersionThe version of this data structure.
DeviceIDA value that identifies a touch device. This is a unique number that may vary from machine to machine but will be the same during any given session.
FrameNumberThis value is incremented every time a new packet of contacts is detected.
ElementCountNumber of elements in the sensitivity array. This value should be ScanSizeY * ScanSizeX.
SensitivityPointer to an array of sensitivity values. The size of the Sensitivity block is ElementCount _ sizeof(unsigned short). The location of each point is calculated as (Y _ ScanSizeX) + X.

WacomMTHitRect

This structure represents a hit test rectangle. For opaque tablets (such as Intuos), the hitrect coordinates are normalized to a value between 0.0 and 1.0. For display tablets (such as Cintiq), the hitrect coordinates are desktop pixel values.

typedef struct _WacomMTHitRect
{
float originX;
float originY;
float width;
float height;
} WacomMTHitRect;
FieldDefinition
originXThe horizontal value of the origin point of the rectangle.
originYThe vertical value of the origin point of the rectangle.
widthThe horizontal width of the rectangle.
heightThe vertical height of the rectangle.

WacomMTProcessingMode

Used by the callback functions. Provides instructions for how to process the data. If no flags are set the data is sent to the callback and not processed by the system.

typedef enum _WacomMTProcessingMode
{
WMTProcessingModeNone = 0,
WMTProcessingModeObserver = (1 << 0),
WMTProcessingModePassThrough = (1 << 1),
WMTProcessingModeReserved = (1 << 31)
} WacomMTProcessingMode;
FieldDefinition
WMTProcessingModeNoneThe data is sent to the callback and no other processing is done.
WMTProcessingModeObserverThe data is posted in parallel to the OS for processing.
WMTProcessingModePassthroughThe data is posted in parallel to the OS and WMT observers.

Functions

WacomMTInitialize

Syntax

WacomMTError WacomMTInitialize(libraryAPIVersion)

This function attempts to connect the application to the driver and must be called successfully before any other Wacom Multi-Touch function is called.

ParameterTypeDescription
libraryAPIVersionintThis is the version of the API that the application is using. This value will be used by the API to construct the expected data structures for the application. Please use the provided predefined value WACOM_MULTI_TOUCH_API_VERSION.

Return Value See the WacomMTError enumeration definition.

WacomMTQuit

Syntax

void WacomMTQuit()

This function closes the connection to the driver service. This should be called when the application is closing or no longer needs touch data. After calling WacomMTQuit, WacomMTInitialize would need to be called again to resume touch interaction.

WacomMTGetAttachedDeviceIDs

Syntax

int WacomMTGetAttachedDeviceIDs(deviceArray, bufferSize)

This function returns the number of multi-touch sensors attached to the system.

ParameterTypeDescription
deviceArrayint *A user allocated buffer used to return the deviceIDs of the currently attached devices. This call will provide as many devices as will fit into the provided buffer. This can be NULL.
bufferSizesize_tThe size of the buffer provided. Should be zero if no buffer provided.

Return Value
The return value is the number of sensors attached to the system.

WacomMTGetDeviceCapabilities

Syntax

WacomMTError WacomMTGetDeviceCapabilities(deviceID, capabilityBuffer)

This function fills in a caller allocated WacomMTCapability structure with the capability information for the requested device identifier.

ParameterTypeDescription
deviceIDintThe ID of the device. These IDs can be from the GetAttachedDeviceIDs array, the finger packet deviceID member, the blob packet deviceID member or the raw packet deviceID member.
capabilityBufferWacomMTCapability *This is the caller allocated structure that is filled in with device capability data upon success. This structure will be defined by the API version provided at initialization.

Return Value
See the WacomMTError enumeration definition.

WacomMTRegisterAttachCallback

Syntax

WacomMTError WacomMTRegisterAttachCallback(attachCallback, userData)

This function allows you to register a callback function that you would like called when a new touch device is attached. When registered the API will issue a callback for each device currently attached. Only one attached callback can be registered for each process. To cancel the attached callback, a process can call this function with NULL.

ParameterTypeDescription
attachCallbackWMT_ATTACH_CALLBACKThe function definition for this callback is:
void (*WMT_ATTACH_CALLBACK)(WacomMTCapability deviceInformation, void *userData )
userDatavoid *This function will be called with the WacomMTCapability structure for the device attached and the userData provided when the call was registered.

Return Value
See the WacomMTError enumeration definition.

WacomMTRegisterDetachCallback

Syntax

WacomMTError WacomMTRegisterDetachCallback(detachCallback, userData)

This function allows you to register a callback function that you would like called when a touch device is detached. Only one detach callback can be registered for each process. To cancel the detach callback, a process can call this function with NULL.

ParameterTypeDescription
detachCallbackWMT_DETACH_CALLBACKThe function definition for this callback is:
void (*WMT_DETACH_CALLBACK)(int deviceId, void *userData)
userDatavoid *The function will be called with the deviceID of the sensor that has been detached and the userData provided when the call was registered.

Return Value
See the WacomMTError enumeration definition.

WacomMTRegisterFingerReadCallback

Syntax

WacomMTError WacomMTRegisterFingerReadCallback(deviceID, hitRect, mode, fingerCallback, userData)

This function allows you to register a callback function that you would like called when a finger touch packet is ready and within the requested device's hit rectangle. A process can create as many callbacks as needed but only one callback per device hit rectangle. If you wish to cancel a callback, call this function or WacomMTUnRegisterFingerReadCallback() on an existing device hit rectangle with NULL for the function. The callbacks are processed in the order in which they are created.

Parameter Type Description
deviceID int The deviceID of the device.
hitRect WacomMTHitRect *

A rectangle used to hit test the data. If a finger begins contact within the hit rectangle the callback will be called. The callback will continue to be called for that finger until that contact is removed from the device. If a contact begins outside the hit rectangle, the callback will not be called for that finger. A NULL rectangle will assume the entire device surface. The hit rectangle is defined in the logical units of the device. See WacomMTCapability structure for a definition of logical units.

mode WacomMTProcessingMode Specifies what the API does with the data during the callback.
fingerCallback WMT_FINGER_CALLBACK

The function definition for this callback is:
int (*WMT_FINGER_CALLBACK)(WacomMTFingerCollection *fingerPacket, void *userData)
The function will be called with the fingerPacket structure filled in and the userData provided when the call was registered. The fingerPacket is only valid while the callback is being processed. This memory is released/reused upon return from the callback. The return value is reserved and should be zero.

userData void * A parameter provided by the caller and echoed back in the callback function.

Return Value
See the WacomMTError enumeration definition.

WacomMTUnRegisterFingerReadCallback

Syntax

WacomMTError WacomMTUnRegisterFingerReadCallback(deviceID, hitRect, mode, userData)

This function allows you to cancel a callback.

Parameter Type Description
deviceID int The deviceID of the device.
hitRect WacomMTHitRect *

A rectangle that was registered for callbacks. A NULL rectangle will assume the entire device surface. The hit rectangle is defined in the logical units of the device. See structure for a definition of logical units.

mode WacomMTProcessingMode Specifies what the API does with the data during the callback.
userData void *

A parameter provided by the caller and echoed back in the callback function.

Return Value
If a matching hitrect/mode is not found, then this function will return an error. See the WacomMTError enumeration definition.

WacomMTRegisterBlobReadCallback

Syntax

WacomMTError WacomMTRegisterBlobReadCallback(deviceID, hitRect, mode, blobCallback, userData)

This function allows you to register a callback function that you would like called when blob data is ready and within the requested device's hit rectangle. A process can create as many callbacks as needed but only one callback per device hit rectangle. If you wish to cancel a callback, call this function on an existing device hit rectangle with NULL for the function. The callbacks are processed in the order in which they are created.

Parameter Type Description
deviceID int The deviceID of the device.
hitRect WacomMTHitRect *

A rectangle used to hit test the data. If any part of the blob contact is within the hit rectangle the callback will be called. A NULL rectangle will assume the entire device surface. The hit rectangle is defined in the logical units of the device. See WacomMTCapability structure for a definition of logical units.

mode WacomMTProcessingMode Specifies what the API does with the data during the callback.
blobCallback WMT_BLOB_CALLBACK

The function definition for this callback is:
int (*WMT_BLOB_CALLBACK )(WacomMTBlobAggregate *blobPacket, void *userData)
The function will be called with the blobPacket structure filled in and the userData provided when the call was registered. The blobPacket is only valid while the callback is being processed. This memory is released/reused upon return from the callback. The return value is reserved and should be zero.

userData void * A parameter provided by the caller and echoed back in the callback function.

Return Value
See the WacomMTError enumeration definition.

WacomMTRegisterRawReadCallback

Syntax

WacomMTError WacomMTRegisterRawReadCallback(deviceID, mode, rawCallback, userData)

This function allows you to register a callback function that you would like called when raw data is ready for the specified device. Only one callback can be registered per device. If you wish to cancel the device callback call, this function with NULL for the callback. The callbacks are processed in the order in which they are created.

ParameterTypeDescription
deviceIDintThe deviceID of the device.
modeWacomMTProcessingModeSpecifies what the API does with the data during the callback.
rawCallbackWMT_RAW_CALLBACKThe function definition is:
int (*WMT_RAW_CALLBACK)(WacomMTRawData *rawPacket, void *userData)
The function will be called with the rawPacket structure filled in and the userData provided when the call was registered. The rawPacket is only valid while the callback is being processed. This memory is released/reused upon return from the callback. The return value is reserved and should be zero.
userDatavoid *A parameter provided by the caller and echoed back in the callback function.

Return Value
See the WacomMTError enumeration definition.

WacomMTRegisterFingerReadHWND

Syntax

WacomMTError WacomMTRegisterFingerReadHWND(deviceID, mode, hWnd, bufferDepth)

This function allows you to register a window handle to receive finger data. When a packet of finger data for the given device is ready a WM_FINGERDATA message will be sent to the window handle. The lParam parameter will be a pointer to a WacomMTFingerCollection structure that contains the finger data. The bufferDepth parameter determines the number of callback buffers created. The buffers are used in a ring format. Only one finger data message is allowed for each device per window handle. The window handle is also used to produce a hit rectangle. The hit rectangle is calculated when this function is called. If the window is moved or resized this function should be called again. If the bufferDepth is changed, all existing buffers will be invalid. To cancel the device callback, this function can either be called with a bufferDepth of zero, or the function WacomMTUnRegisterFingerReadHWND can be used.

ParameterTypeDescription
deviceIDintThe deviceID of the device.
modeWacomMTProcessingModeSpecifies what the API does with the data during the callback.
hWndHWNDThis is the window handle that will receive the WM_FINGERDATA message.
bufferDepthintThis is the number of WacomMTFingerCollection data structures that will be allocated for the message callbacks.

Return Value
See the WacomMTError enumeration definition.

WacomMTUnRegisterFingerReadHWND

Syntax

WacomMTError WacomMTUnRegisterFingerReadHWND(hWnd)

This function allows you to unregister a window handle from receiving touch finger data updates. The function will return an error for an invalid window handle.

ParameterTypeDescription
HWNDHWNDThis is a window handle that was registered to receive the WM_FINGERDATA message.

Return Value
See the WacomMTError enumeration definition.

WacomMTRegisterBlobReadHWND

Syntax

WacomMTError WacomMTRegisterBlobReadHWND(deviceID, mode, hWnd, bufferDepth)

This function allows you to register a window handle to receive blob data. When a blob packet for the given device is ready a WM_BLOBDATA message will be sent to the window handle. The lParam parameter will be a pointer to a WacomMTBlobAggregate structure that contains the blob data. The bufferDepth parameter determines the number of callback buffers created. The buffers are used in a ring format. Only one blob data callback is allowed for each device per window handle. The window handle is also used to produce a hit rectangle. The hit rectangle is calculated when this function is called. If the window is moved or resized this function should be called again. If the bufferDepth is changed, all existing buffers will be invalid. To cancel the device callback, this function can be called with a bufferDepth of zero, or the function WacomMTUnRegisterBlobReadHWND can be used.

ParameterTypeDescription
deviceIDintThe deviceID of the device.
modeWacomMTProcessingModeSpecifies what the API does with the data during the callback.
hWndHWNDThis is the window handle that will receive the WM_BLOBDATA message.
bufferDepthintThis is the number of WacomMTBlobAggregate data structures that will be allocated for the message callbacks.

Return Value
See the WacomMTError enumeration definition.

WacomMTUnRegisterBlobReadHWND

Syntax

WacomMTError WacomMTUnRegisterBlobReadHWND(hWnd)

This function allows you to unregister a window handle from receiving touch blob data updates. The function will return an error for an invalid window handle.

ParameterTypeDescription
hWndHWNDThis is a window handle that was registered to receive the WM_FINGERDATA message.

Return Value
See the WacomMTError enumeration definition.

WacomMTRegisterRawReadHWND

Syntax

WacomMTError WacomMTRegisterRawReadHWND(deviceID, mode, hWnd, bufferDepth)

This function allows you to register a window handle to receive raw data. When a data frame for the given device is ready a WM_RAWDATA message will be sent to the window handle. The lParam parameter will be a pointer to a WacomMTRawData structure. The bufferDepth parameter determines the number of callback buffers created. The buffers are used in a ring format. Only one raw data callback is allowed for each device per window handle. If the bufferDepth is changed, all existing buffers will be invalid. To cancel the device callback this function should be called with the bufferDepth equal to zero. Developers are recommended to use WacomMTRegisterRawReadCallback instead of this call.

ParameterTypeDescription
deviceIDintThe deviceID of the device.
modeWacomMTProcessingModeSpecifies what the API does with the data during the callback.
hWndHWNDThis is the window handle that will receive the WM_RAWDATA message.
bufferDepthintThis is the number if RawData data structures that will be allocated for the message callbacks.

Return Value
See the WacomMTError enumeration definition.

WacomMTMoveRegisteredFingerReadCallback

Syntax

WacomMTError WacomMTMoveRegisteredFingerReadCallback(deviceID, oldHitRect, mode, newHitRect, userData)

This function allows you to register a new finger hitrect without having to first explicitly unregister an old hitrect.

Parameter Type Description
deviceID int The deviceID of the device.
oldHitRect WacomMTHitRect *

A rectangle that was registered for callbacks. A NULL rectangle will assume the entire device surface. The hit rectangle is defined in the logical units of the device. See WacomMTCapability structure for a definition of logical units.

mode WacomMTProcessingMode Specifies what the API does with the data during the callback.
newHitRect WacomMTHitRect *

A new rectangle to be registered for callbacks. A NULL rectangle will assume the entire device surface. The hit rectangle is defined in the logical units of the device. See WacomMTCapability structure for a definition of logical units.

userData void * A parameter provided by the caller and echoed back in the callback function.

Return Value

If oldHitRect/mode is not found or if the newHitRect/mode has already been registered, then this function will return an error. See the WacomMTError enumeration definition.

WacomMTMoveRegisteredBlobReadCallback

Syntax

WacomMTError WacomMTMoveRegisteredBlobReadCallback(deviceID, oldHitRect, mode, newHitRect, userData)

This function allows you to register a new blob hitrect without having to first explicitly unregister an old hitrect.

ParameterTypeDescription
deviceIDintThe deviceID of the device.
oldHitRectWacomMTHitRect * A rectangle that was registered for callbacks. A NULL rectangle will assume the entire device surface. The hit rectangle is defined in the logical units of the device. See WacomMTCapability structure for a definition of logical units.
modeWacomMTProcessingModeSpecifies what the API does with the data during the callback.
newHitRectWacomMTHitRect * A new rectangle to be registered for callbacks. A NULL rectangle will assume the entire device surface. The hit rectangle is defined in the logical units of the device. See WacomMTCapability structure for a definition of logical units.
userDatavoid *A parameter provided by the caller and echoed back in the callback function.

Return Value
If oldHitRect/mode is not found or if the newHitRect/mode has already been registered, then this function will return an error. See the WacomMTError enumeration definition.