LuciadCPillar C# 2024.1.02
Luciad.Input.Mouse.MouseGestureRecognizer Class Reference

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

Inheritance diagram for Luciad.Input.Mouse.MouseGestureRecognizer:

Public Member Functions

 MouseGestureRecognizer (Luciad.Input.IInputEventCallback callback)
 Creates a MouseGestureRecognizer that passes the generated high level IInputEvents to the given callback. More...
 
void Dispose ()
 
override bool Equals (object obj)
 
override int GetHashCode ()
 
void OnKeyEvent (Luciad.Input.KeyEvent keyEvent)
 Entry point for the key events of the gesture recognizer. More...
 
void OnMouseMoveEvent (Luciad.Input.Mouse.MouseMoveEvent mouseMoveEvent)
 Entry point for the mouse move events of the gesture recognizer. More...
 
void OnMousePressedEvent (Luciad.Input.Mouse.MousePressedEvent mousePressedEvent)
 Entry point for the mouse pressed events of the gesture recognizer. More...
 
void OnMouseReleasedEvent (Luciad.Input.Mouse.MouseReleasedEvent mouseReleasedEvent)
 Entry point for the mouse released events of the gesture recognizer. More...
 
void OnScrollEvent (Luciad.Input.ScrollEvent scrollEvent)
 Entry point for the scroll events of the gesture recognizer. More...
 

Properties

double DisplayScale [get, set]
 The display scale factor. More...
 
double Dpi [get, set]
 The display pixel density, expressed 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 MultiClickInterval [get, set]
 The interval (in milliseconds) used to detect multiple clicks. More...
 

Detailed Description

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

High level events are subclasses of IInputEvent such as MouseClickEvent. Low levels are used to create those high level events and are dropped afterwards.

For example, a mouse pressed + (possibly multiple) mouse moved + a mouse released sequence is recognized as a drag gesture. A mouse pressed + a mouse released sequence is recognized as a click 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 MouseGestureRecognizer is optional. Events containing MouseButton.unknown() as the mouse button are not processed. 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

◆ MouseGestureRecognizer()

Luciad.Input.Mouse.MouseGestureRecognizer.MouseGestureRecognizer ( Luciad.Input.IInputEventCallback  callback)
inline

Creates a MouseGestureRecognizer that passes the generated high level IInputEvents to the given callback.

Parameters
callbackthe callback that receive generated IInputEvents. Can not be null.
Exceptions
System.ArgumentNullExceptionIf callback is null.

Member Function Documentation

◆ Dispose()

void Luciad.Input.Mouse.MouseGestureRecognizer.Dispose ( )
inline

◆ Equals()

override bool Luciad.Input.Mouse.MouseGestureRecognizer.Equals ( object  obj)
inline

◆ GetHashCode()

override int Luciad.Input.Mouse.MouseGestureRecognizer.GetHashCode ( )
inline

◆ OnKeyEvent()

void Luciad.Input.Mouse.MouseGestureRecognizer.OnKeyEvent ( Luciad.Input.KeyEvent  keyEvent)
inline

Entry point for the key events of the gesture recognizer.

Parameters
keyEventthe low level key event.

◆ OnMouseMoveEvent()

void Luciad.Input.Mouse.MouseGestureRecognizer.OnMouseMoveEvent ( Luciad.Input.Mouse.MouseMoveEvent  mouseMoveEvent)
inline

Entry point for the mouse move events of the gesture recognizer.

Parameters
mouseMoveEventthe low level mouse move event.

◆ OnMousePressedEvent()

void Luciad.Input.Mouse.MouseGestureRecognizer.OnMousePressedEvent ( Luciad.Input.Mouse.MousePressedEvent  mousePressedEvent)
inline

Entry point for the mouse pressed events of the gesture recognizer.

Parameters
mousePressedEventthe low level mouse press event.

◆ OnMouseReleasedEvent()

void Luciad.Input.Mouse.MouseGestureRecognizer.OnMouseReleasedEvent ( Luciad.Input.Mouse.MouseReleasedEvent  mouseReleasedEvent)
inline

Entry point for the mouse released events of the gesture recognizer.

Parameters
mouseReleasedEventthe low level mouse released event.

◆ OnScrollEvent()

void Luciad.Input.Mouse.MouseGestureRecognizer.OnScrollEvent ( Luciad.Input.ScrollEvent  scrollEvent)
inline

Entry point for the scroll events of the gesture recognizer.

Parameters
scrollEventthe low level mouse scroll event.

Property Documentation

◆ DisplayScale

double Luciad.Input.Mouse.MouseGestureRecognizer.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.Mouse.MouseGestureRecognizer.Dpi
getset

The display pixel density, expressed in dots per inch.

[get]

Returns the display pixel density, expressed in dots per inch.

[set]

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

◆ DragThreshold

Luciad.Input.ScreenDistance Luciad.Input.Mouse.MouseGestureRecognizer.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. It means that the mouse cursor has to move at least that distance before it can be detected as a drag gesture.

[set]

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

The default value in device independent pixels is 2 pixels.

◆ MultiClickInterval

uint Luciad.Input.Mouse.MouseGestureRecognizer.MultiClickInterval
getset

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

[get]

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

[set]

Sets the interval (in milliseconds) used to detect multiple clicks. The default is 400 ms. If the interval is set to 0, no multiple clicks will be detected.