Skip to main content

Reference

Context Management

createContextForTablet:type

Syntax

+ (UInt32) createContextForTablet:(UInt32)index type:(AEContextType)contextType

This function requests the driver create a context for a tablet.

ParameterTypeDescription
indexUInt32The index of the tablet of interest.
contextTypeAEContextTypeHow the context is initialized.

Return Value
Returns a unique UInt32 value that represents the context created for the application or 0 in case of error.

Comments
An application needs to create a context before it can query or override functions of tablet controls.

See Also
Type definitions, AEContextType.

destroyContext

Syntax

+ (void)destroyContext:(UInt32)context

This function requests the driver delete a context created for a tablet.

ParameterTypeDescription
contextUInt32The context to be deleted.

Return Value
None

Comments
An application must destroy the context it creates when it's done with the context or upon termination.

Get Data

dataForAttribute:ofType:routingTable:

Syntax

+ (NSAppleEventDescriptor*) dataForAttribute:(DescType)attribute ofType:(DescType)dataType routingTable:(NSAppleEventDescriptor *)routingDesc

Query for an attribute in the Wacom tablet driver.

ParameterTypeDescription
attributeDescTypeID of an attribute exposed by some object in the driver (e.g. pName for tablet name).
dataTypeDescTypeType of data (e.g. typeUTF8Text for name).
routingDescNSAppleEventDescriptorHow to find the object which contains the attribute in the driver object hierarchy. Pass the result of one of the +routingTableForXXX methods defined below.

Return Value
Returns an autoreleased NSAppleEventDescriptor that contains the data for the attribute or nil in case of error.

Comments
In order to pick which attribute to get, you must supply an Apple Event routing table which directs this request within the driver's object hierarchy. A number of methods are defined in this class to create routing tables for various structures.

controlCountOfContext:forControlType:

Syntax

+ (UInt32) controlCountOfContext:(UInt32)context forControlType:(eAETabletControlType)controlType

This function requests the number of tablet controls of the specified type on a tablet.

ParameterTypeDescription
contextUInt32The context for the tablet of interest.
contextTypeAEContextTypeHow the context is initialized.

Return Value
Returns the number of tablet controls of the specified type on a tablet.

See Also
createContextForTablet
AEContextType
eAETabletControlType

functionCountOfControl:ofContext:forControlType:

Syntax

+ (UInt32) functionCountOfControl:(UInt32)control ofContext:(UInt32)context forControlType:(eAETabletControlType)controlType

This function requests the number of functions for a specific tablet control.

ParameterTypeDescription
controlUInt32The index of the control of interest.
contextUInt32The context for the tablet of interest
controlTypeeAETabletControlType Type of tablet control of interest.

Return Value
Returns the number of functions for a specific tablet control.

See Also
eAETabletControlType

tabletCount

Syntax

+ (UInt32) tabletCount

This function requests the number of tablets.

ParameterTypeDescription
tabletUInt32The index of the tablet of interest.

Return Value
Returns the number of tablets.

Set Data

setBytes:ofSize:ofType:forAttribute:routingTable:

Syntax

+ (BOOL) setBytes:(void*)bytes ofSize:(UInt32)size ofType:(DescType)dataType forAttribute:(DescType)attribute routingTable:(NSAppleEventDescriptor *)routingDesc

This function sets the value of an attribute in the Wacom tablet driver.

ParameterTypeDescription
sizeUInt32Number of bytes of the attribute data.
dataTypeDescTypeData type for the attribute of interest.
attributeDescTypeAttribute ID.
routingDescNSAppleEventDescriptorHow to get to the attribute. Pass the result of one of the +routingTableForXXX methods.

Return Value
Returns a true on success.

Comments
In order to pick which attribute to set, you must supply an Apple Event routing table which directs this request within the driver's object hierarchy. A number of methods are defined in this class to create routing tables for various structures.

See Also
AEContextType

Raw Routing Tables

If you use the raw routing tables to set an attribute. That would change the GLOBAL tablet object, so the changes you make will affect ALL applications.

routingTableForDriver

Syntax

+ (NSAppleEventDescriptor *)routingTableForDriver

Request a routing table to send commands to the driver.

Return Value
Returns an autoreleased NSAppleEventDescriptor representing the tablet driver AppleEvent object.

routingTableForTablet

Syntax

+ (NSAppleEventDescriptor *) routingTableForTablet:(UInt32)tablet

Requests a routing table to send commands to the tablet object in the driver.

ParameterTypeDescription
tabletUInt32tablet index, 1-relative

Return Value

Returns an Apple Event descriptor which will send commands to the tablet object in the driver.

Comments

  • You should ALMOST NEVER use this routing table to set an attribute. That would change the GLOBAL tablet object, so the changes you make will affect ALL applications.

  • However, you may need this to get certain attributes.

routingTableForTablet:transducer

Syntax

+ (NSAppleEventDescriptor *) routingTableForTablet:(UInt32)tablet transducer:(UInt32)transducer

Requests a routing table to send commands to a transducer in the given tablet.

ParameterTypeDescription
tabletUInt32tablet index, 1-relative
transducerUInt32transducer index, 1-relative

Return Value

Returns an Apple Event descriptor which will send commands to a transducer in the given tablet.

Context-Based

  • You should always set attributes within a context, so that your settings do not affect other applications. (So these are the methods you generally want to use!)

  • These require you to have created a context with +createContextForTablet.

routingTableForContext

Syntax

+ (NSAppleEventDescriptor *) routingTableForContext:(UInt32)context

Requests a routing table to send commands to context object in the driver.

ParameterTypeDescription
contextUInt32ID of custom context created by +createContextForTablet:type:

Return Value

Returns an Apple Event descriptor which will send commands to the context object in the driver.

Comments
Your application should create a context to issue set requests.

See Also
createContextForTablet

routingTableForContext:control:controlType:

Syntax

+ (NSAppleEventDescriptor *) routingTableForContext:(UInt32)context control:(UInt32)control controlType:(eAETabletControlType)controlType

Requests a routing table to send commands to a tablet control object in the driver.

ParameterTypeDescription
contextUInt32ID of custom context created by +createContextForTablet:type:
controlID of control to be targeted.
controlTypeType of control being targeted.

Return Value
Returns an Apple Event descriptor which will send commands to a tablet control object in the driver.

Comments
Your application should create a context to issue set requests.

See Also
eAETabletControlType

routingTableForContext:control:function:forControlType

Syntax

+ (NSAppleEventDescriptor *) routingTableForContext:(UInt32)context control:(UInt32)control controlType:(eAETabletControlType)controlType function:(UInt32)function

Requests a routing table to send commands to a function of a tablet control object.

ParameterTypeDescription
ContextUInt32ID of custom context created by +createContextForTablet:type:
controlUInt32ID of control to be targeted.
controlTypeeAETabletControlTypeType of control being targeted.
functionUInt32Function index to be targeted.

Return Value
Returns an Apple Event descriptor which will send commands to a function of a tablet control object in the driver.

Comments
Your application should create a context to issue set requests.

See Also
eAETabletControlType

Type Definitions

AEContextType

LabelDescription
pContextTypeDefaultTablet output areas are reset to full size, current transducers are acquired, the context is marked non-customizable (control panel mapping changes don't affect it), and the context is enabled.
This is the appropriate type for applications which want to take over tablet mapping.
pContextTypeBlankThe context is enabled, but the rest of the work done in creating a default context is skipped.
This is appropriate for contexts which only customize buttons, and should still track other user changes in the control panel.

eAETabletControlType

Cross-process notifications control type

LabelDescription
eAETouchRingTouchRing control
eAETouchStripTouchStrip control
eAEExpressKeyessKey control

Properties

Driver Properties

LabelTypePermission
pVersiontypeVersionread only
pRatetypeUInt16read only
pTabletDriverPrefsused with a save eventnot applicable

Tablet Properties

LabelTypePermission
pVersiontypeVersionread only
pNametypeUTF8Textread only
pIsConnectedtypeBooleanread only
pTabletModeltypeSInt16read only
pXDimensiontypeSInt32read only
pYDimensiontypeSInt32read only
pResolutiontypeSInt32read only
pTabletSizetypeLongRectangleread only
pOrientationtypeEnumerated (eOrientation)read/write
pTiltLevelstypeSInt16read only

Tablet Controls (TouchRing, ExpressKeys and TouchStrip)

LabelTypePermission
pVersiontypeVersionread only
pFunctionAvailabletypeBooleanread only
pControlMinValuetypeUInt32read only
pControlMaxValuetypeUInt32read only
pControlLocationtypeUInt32read only
pIconWidthtypeUInt32read only
pIconPixelFormattypeBooleanread only
pOverrideFlagtypeBooleanread/write
pOverrideNametypeUTF8Textread/write
pOverrideIcontypeWTDDatawrite only

Application Properties

LabelTypePermission
pAppIDtypeUInt32 (4 char code)read only
pAppNametypeUTF8Text}read only

Pen Properties

LabelTypePermission
pNametypeUTF8Textread only
pTiltSenstypeSInt16read/write
pClickAssisttypeBooleanread/write
pAssistDistancetypeUInt32read/write
pAssistTimetypeUInt32read/write
pTypetypeUInt16read only
pSerialNumbertypeUInt32read only
pUniqueIDtypeLongPointread only
pPositioningModetypeEnumerated (ePositioningMode)read/write
pMapScreenAreatypeQDRectangleread/write
pMapTabletAreatypeLongRectangleread/write
pMapDisplayNumtypeUInt32write only

Button Properties

LabelTypePermission
pNametypeUTF8Textread only
pButtonFunctiontypeSInt32read only
pPressLevelstypeSInt32read only
pClickPressuretypeSInt16read/write
pPressureSentypeEnumerated (ePressureRange)read/write
pForceRangetypeSInt16read/write
pForceMintypeSInt16read/write
pForceMaxtypeSInt16read/write
pButtonKeystypeUTF8Textread/write
pButtonRuntypeUTF8Textread/write
pButtonModifierstypeUInt32read/write

Wheel Properties

LabelTypePermission
pWheelFunctiontypeEnumerated (eWheelFunction)read/write
pWheelReverseDirectiontypeBooleanread/write
pWheelLinesPerNotchtypeSInt32read/write
pWheelKeysUptypeUTF8Textread/write
pWheelKeysDowntypeUTF8Textread/write

Roller Properties

LabelTypePermission
pRollerFunctionttypeEnumerated (eRollerFunction)read/write
pRollerSentypeEnumerated (eRollerRange)read/write
pRollerReverseDirectiontypeUTF8Textread/write
pRollerKeysDowntypeUTF8Textread/write
LabelTypePermission
pNametypeUTF8Textread only
pMenuFunctiontypeEnumerated (eMenuFunction)read/write
pMenuKeystypeUTF8Textread/write
pMenuRuntypeUTF8Textread/write
LabelTypePermission
pPopupFunctiontypeEnumerated (ePopupFunction)read/write
pPopupKeystypeUTF8Textread/write
pPopupRuntypeUTF8Textread/write

Enumerations

Tablet Orientation Enums

eOrientation

eOrientLandscape
eOrientPortrait
eOrientLandscapeFlipped
eOrientPortraitFlipped

Cursor Positioning Mode Enums

ePositioningMode

ePositioningAbsolute
ePositioningRelative

Tip Pressure Sensitivity Enums

ePressureRange

ePressureSoftest
ePressureSofter
ePressureSoft
ePressureNormal
ePressureFirm
ePressureFirmer
ePressureFirmest

Button Function Enums

eButtonFunction

eButtonFuncIgnore
eButtonLeftClick
eButtonMiddleClick
eButtonRightClick
eButtonLeftDoubleClick
eButtonMiddleDoubleClick
eButtonRightDoubleClick
eButtonLeftClickLock
eButtonKeystrokes
eButtonModifiers
eButtonPressureHold
eButtonModeToggle
eButtonMacro
eButtonScreenMacro
eButtonAutoErase
eButtonBumbleFree
eButtonEraseKeystroke
eButtonEraseModifier
eButtonEraseMacro
eButtonButton4Click
eButtonButton5Click
eButtonMiddleClickLock
eButtonRightClickLock
eButtonRunApplication
eButtonToggleInkAnywhere
eButtonDisplayToggle
eButtonPanScroll
eButtonBack
eButtonForward
eButtonShowDesktop
eButtonHelp
eButtonRadialMenu
eButtonFinePoint

Wheel Function Enums

eWheelFunction

eWheelLineScroll
eWheelPagecroll
eWheelKeyScroll
eWheelIgnored

Roller Function Enums

eRollerFunction

eRollerZAxis
eRollerPressure
eRollerScroll
eRoller15Button
eRollerKeyScroll
eRollerIgnored

Roller Sensitivity Range Enums

eRollerRange

eRangeMax
eRangeMed
eRangeMin

Tablet Menu Function Enums

eMenuFunction

eMenuFuncIgnored
eMenuKeystrokes
eMenuMacro
eMenuRunApplication
eMenuAbsolute
eMenuRelative
eMenuQuickPoint
eMenuToggleInkAnywhere
eMenuSoftPressure
eMenuNormalPressure
eMenuFirmPressure

ePopupFunction

ePopupKeystrokes
ePopupMacro
ePopupRunApplication
ePopupAbsolute
ePopupRelative