Target Tap API

Detailed Description

These functions detect when the target touches the physical screen. You can set a threshold for how long the target must touch to be detected.

List of Functions

ZSError  zsIsTargetTapPressed (ZSHandle targetHandle, ZSBool* isTapPressed)
ZSError  zsSetTargetTapHoldThreshold (ZSHandle targetHandle, ZSFloat seconds)
ZSError  zsGetTargetTapHoldThreshold (ZSHandle targetHandle, ZSFloat* seconds)

Function Descriptions

ZSError zsGetTargetTapHoldThreshold ( ZSHandle  targetHandle,
ZSFloat*   seconds 
)

Gets the threshold for how long the tracker target must touch the surface zSpace display before the ZS_TRACKER_EVENT_TAP_HOLD event is generated.

Parameters:
[in] targetHandle A handle to the tracker target.
[out] seconds The number of seconds the tracker target must touch.
ZSError zsIsTargetTapPressed ( ZSHandle  targetHandle,
ZSBool*   isTapPressed 
)

Checks whether the target is tapping or pressing the display's surface.

Parameters:
[in] targetHandle A handle to the tracker target.
[out] isTapPressed True if the tracker target is touching, false if otherwise.
Example:
 ZSContext context = ...;

 ZSHandle stylusHandle = NULL;
 zsFindTargetByType(context, ZS_TARGET_TYPE_PRIMARY, 0, &stylusHandle);

 // Check if the target is currently pressed against the zSpace display.
 ZSBool currentTapState = 0;
 zsIsTargetTapPressed(stylusHandle, &currentTapState);
ZSError zsSetTargetTapHoldThreshold ( ZSHandle  targetHandle,
ZSFloat  seconds 
)

Sets the threshold for how long the tracker target must touch the surface zSpace display before the ZS_TRACKER_EVENT_TAP_HOLD event is generated.

Parameters:
[in] targetHandle A handle to the tracker target.
[in] seconds The number of seconds the tracker target must touch.