User Tools

Site Tools


editing_tap_event_translation_max_threshold

Editing Tap Event Translation Max Threshold

The “translation_max” attribute of the “<point>” tag defines the maximum allowable movement of a touch point in a single processing frame.

In the example below translation_max=“2” is used to set a translation threshold on the “n-hold” gesture. This means that ANY touch point that moves more than 2 pixels in a single processing frame will not meet the matching criteria and therefor cannot be part of the HOLD gesture.

<Gesture id="n-hold" type="hold">
    <match>
        <action>
            <initial>
                <point event_duration_min="500" translation_max="2"/>
                <cluster point_number="0" point_number_min="1" point_number_max="5"/>
            </initial>
        </action>
    </match>       
    <analysis>
        <algorithm>
            <library module="hold"/>
            <returns>
                <property id="hold_x" result="x"/>
                <property id="hold_y" result="y"/>
                <property id="hold_n" result="n"/>
            </returns>
        </algorithm>
    </analysis>    
    <mapping>
        <update dispatch_type="discrete" dispatch_reset="cluster_remove">
            <gesture_event  type="hold">
                <property ref="hold_x"/>
                <property ref="hold_y"/>
                <property ref="hold_n"/>
            </gesture_event>
        </update>
    </mapping>
</Gesture>
editing_tap_event_translation_max_threshold.txt · Last modified: 2019/01/29 19:06 (external edit)