1.9.1 Data Structures

qtm_gestures_2d_control_t

The qtm_gestures_2d_control_t data interface is a container structure which controls the input and output of this module.

FieldUnitRange/OptionsParameter
qtm_gestures_2d_dataqtm_gestures_2d_data _t*PointerPointer to the gestures data structure
qtm_gestures_2d_configqtm_gestures_2d_config _t*PointerPointer to the gestures config structure

qtm_gestures_2d_config _t

The qtm_gestures_2d_config _t data structure is the configuration structure passed to the module.

FieldUnitRange/OptionsParameter
horiz_position0uint16_tPointerPointer to the horizontal contact 0 position
vertical_position0uint16_tPointerPointer to the vertical contact 0 position
surface_status0uint8_tPointerPointer to the status of contact 0
horiz_position1uint16_tPointerPointer to the horizontal contact 1 position
vertical_position1uint16_tPointerPointer to the vertical contact 1 position
surface_status1uint8_tPointerPointer to the status of contact 1
surface_resolutionuint8_t0 to 255This parameter defines the resolution of surface
tapReleaseTimeoutuint8_t0 to 255This parameter limits the amount of time allowed between the initial finger press and the liftoff. Exceeding this value will cause the firmware to not consider the gesture as a tap gesture.
Note: This value should be lesser than tapHoldTimeout and swipeTimeout
tapHoldTimeoutuint8_t0 to 255
If a finger stays within the bounds set by TAP_AREA and is not removed, the firmware will report a Tap Hold gesture once the gesture timer exceeds this value.
Note: This should be greater than the tapReleaseTimeout and swipeTimeout
swipeTimeoutuint8_t0 to 255
This value limits the amount of time allowed for the swipe gesture (initial finger press, moving in a particular direction, crossing the distance threshold and the liftoff).
Note: This should be greater than the tapReleaseTimeout and lesser than tapHoldTimeout
xSwipeDistanceThresholduint8_t0 to 255This controls the distance traveled in the X-axis direction for detecting Left and Right Swipe gestures.
ySwipeDistanceThresholduint8_t0 to 255This controls the distance traveled in the Y-axis direction for detecting Up and Down Swipe gestures
edgeSwipeDistanceThresholduint8_t0 to 255This controls the distance traveled for Edge Swipe gestures
tapDistanceThresholduint8_t0 to 255This parameter bounds the finger to an area it must stay within to be considered a Tap gesture when the finger is removed and Tap and Hold gesture if the finger is not removed for some time
seqTapDistanceThresholduint8_t0 to 255This parameter limits the allowable distance of the current touch’s initial press from the liftoff position of the previous touch. It is used for multiple taps (double-tap, triple-tap, etc.).

If the taps following the first are within this threshold, then the tap counter will be incremented.

If the following tap gestures exceed this threshold, the previous touch is sent as a single tap, and the current touch will reset the tap counter.
edgeBoundaryuint8_t0 to 255The firmware can also be modified to define an edge region along the border of the touch sensor. With this defined, Swipe gestures that start in an edge region will be reported as Edge Swipe gestures in place of normal Swipe gestures.
wheelPostscalerint8_t-128 to 127This parameter adjusts the rate at which the Wheel gesture is updated in the GUI
wheelStartQuadrantCountint8_t-128 to 127The Wheel gesture movement can be broken down into 90° arcs. The firmware watches for a certain number of arcs to occur in a circular pattern before starting to report Wheel gesture information. The number of arcs that must be first detected is determined by this parameter.

Lower values for this parameter make it faster to start a wheel gesture, but it also makes the firmware prone to prematurely reporting wheel gesture information.

wheelReverseQuadrantCountint8_t-128 to 127This parameter functions like wheelStartQuadrantCount, except it is used when changing the direction of the wheel instead of starting it new. This is used to prevent quick toggling between directions.
pinchZoomThresholduint8_t0 to 255This parameter limits the allowable distance between the two fingers to detect the pinch and the zoom gestures. After crossing this parameter value, if the distance between the contacts is reducing, then the gesture is reported as “PINCH”. After crossing this parameter value, if the distance between the contacts is increasing, then the gesture is reported as “ZOOM”.

qtm_gestures_2d_data_t

The qtm_gestures_2d_data_t data structure is used internally within the module to identify the gesture and to store the status and information.

FieldUnitRange/OptionsParameter
gestures_statusuint8_t0 or 1This indicates if a gesture has been decoded or not
gestures_which_gestureuint8_t0 to 255This contains the current, decoded gesture
gestures_infouint8_t0 to 255

This contains the additional gesture information