LuciadCPillar C# 2024.1.02
Luciad.Input.Touch.TouchGestureRecognizer Class Reference

This class generates high-level touch gesture events from low-level input events. More...

Inheritance diagram for Luciad.Input.Touch.TouchGestureRecognizer:

Public Member Functions

 TouchGestureRecognizer (Luciad.Input.IInputEventCallback callback, Luciad.Concurrent.ITaskScheduler taskScheduler)
 Creates a TouchGestureRecognizer The generated high level IInputEvents are passed to the given callback on the UI thread. More...
 
void Dispose ()
 
override bool Equals (object obj)
 
override int GetHashCode ()
 
void OnTouchEvent (Luciad.Input.Touch.TouchPointEvent touchPointEvent)
 Entry point for the touch events of the gesture recognizer. More...
 

Properties

double DisplayScale [get, set]
 The display scale factor. More...
 
double Dpi [get, set]
 The display pixel density in dots per inch. More...
 
Luciad.Input.ScreenDistance DragThreshold [get, set]
 The screen distance that is used as threshold to detect if a drag is performed. More...
 
uint LongPressThreshold [get, set]
 The threshold to reach (in milliseconds) before a long press event is sent. More...
 
uint MultiTapInterval [get, set]
 The interval (in milliseconds) used to detect multiple taps. More...
 
Luciad.Input.ScreenDistance MultiTapThreshold [get, set]
 The screen distance threshold used to detect multiple taps. More...
 

Detailed Description

This class generates high-level touch gesture events from low-level input events.

High level events are subclasses of IInputEvent such as TouchTapEvent. Sequences of low level events are used to create those high level events.

For example, a touch press + movement of the touch point (possibly multiple times) sequence is recognized as a touch drag gesture. A touch press + a touch release sequence is recognized as a touch tap gesture. This class is useful when adding integration with a platform that does not provide these more high-level events.

A typical use of such a class is to wire it to a UI framework specific class (such as Qt , see QQuickMapObject in the sample code) and make the controller react to the high level event instead of every low level event the framework can fire.

The use of the TouchGestureRecognizer is optional. A controller implementation can use custom conversion code if needed, for example if you want to manage the low level events yourself and create other high level IInputEvent instances.

The events passed to this class are expected to be defined in device independent pixels.

Since
2022.0

Constructor & Destructor Documentation

◆ TouchGestureRecognizer()

Luciad.Input.Touch.TouchGestureRecognizer.TouchGestureRecognizer ( Luciad.Input.IInputEventCallback  callback,
Luciad.Concurrent.ITaskScheduler  taskScheduler 
)
inline

Creates a TouchGestureRecognizer The generated high level IInputEvents are passed to the given callback on the UI thread.

For certain events, like for example a long press, an internal timer is used to determine when an IInputEvent needs to be sent. Due to the use of a timer, it is possible that some work is done on a different thread than the UI thread. The task scheduler can be used to apply the result of the timer on the UI thread.

Parameters
callbackthe callback that receive generated IInputEvents. Can not be null.
taskSchedulera scheduler allowing the caller to receive some IInputEvents on another thread and resolve them on the UI thread. Can be null. If null, some events won't be emitted.
Exceptions
System.ArgumentNullExceptionIf callback is null.

Member Function Documentation

◆ Dispose()

void Luciad.Input.Touch.TouchGestureRecognizer.Dispose ( )
inline

◆ Equals()

override bool Luciad.Input.Touch.TouchGestureRecognizer.Equals ( object  obj)
inline

◆ GetHashCode()

override int Luciad.Input.Touch.TouchGestureRecognizer.GetHashCode ( )
inline

◆ OnTouchEvent()

void Luciad.Input.Touch.TouchGestureRecognizer.OnTouchEvent ( Luciad.Input.Touch.TouchPointEvent  touchPointEvent)
inline

Entry point for the touch events of the gesture recognizer.

Parameters
touchPointEventthe TouchPointEvent object containing a collection of TouchPoints.

Property Documentation

◆ DisplayScale

double Luciad.Input.Touch.TouchGestureRecognizer.DisplayScale
getset

The display scale factor.

[get]

Returns the display scale factor.

[set]

Sets the display scale factor. If no value is provided, a scale factor of 1.0 is assumed.

◆ Dpi

double Luciad.Input.Touch.TouchGestureRecognizer.Dpi
getset

The display pixel density in dots per inch.

[get]

Returns the display pixel density in dots per inch.

[set]

Sets the display pixel density in dots per inch. If no value is provided, the platform standard pixel density is assumed.

◆ DragThreshold

Luciad.Input.ScreenDistance Luciad.Input.Touch.TouchGestureRecognizer.DragThreshold
getset

The screen distance that is used as threshold to detect if a drag is performed.

[get]

Returns the screen distance that is used as threshold to detect if a drag is performed.

[set]

Sets the screen distance that is used as threshold to detect if a drag is performed. It means that the input has to move at least that distance before it can be detected as a drag gesture.

The default drag threshold is a screen distance of 5 mm.

◆ LongPressThreshold

uint Luciad.Input.Touch.TouchGestureRecognizer.LongPressThreshold
getset

The threshold to reach (in milliseconds) before a long press event is sent.

[get]

Returns the threshold to reach (in milliseconds) before a long press event is sent.

[set]

Sets the threshold to reach (in milliseconds) before a long press event is sent. The default is 700 ms.

◆ MultiTapInterval

uint Luciad.Input.Touch.TouchGestureRecognizer.MultiTapInterval
getset

The interval (in milliseconds) used to detect multiple taps.

[get]

Returns the interval (in milliseconds) used to detect multiple taps.

[set]

Sets the interval (in milliseconds) used to detect multiple taps. The default is 400 ms.

If the interval is set to 0, no multiple taps will be detected.

◆ MultiTapThreshold

Luciad.Input.ScreenDistance Luciad.Input.Touch.TouchGestureRecognizer.MultiTapThreshold
getset

The screen distance threshold used to detect multiple taps.

[get]

Returns the screen distance threshold used to detect multiple taps.

[set]

Sets the screen distance threshold used to detect multiple taps. It means that consecutive taps need to be as close as that distance in order to generate an event for a multiple tap.