ImFusion SDK 4.3
TouchEvent Class Referencefinal

#include <ImFusion/GUI/InputEvent.h>

Touch events occur when pressing, releasing, or moving one ore multiple touch points on a touch device. More...

+ Inheritance diagram for TouchEvent:

Detailed Description

Touch events occur when pressing, releasing, or moving one ore multiple touch points on a touch device.

Note that events of type Update and End should only be sent to those handlers that previously accepted a Begin event. Some systems may send an event of type Cancel, which requests to ignore the entire active touch sequence.

Classes

struct  Point
 Record of touch point metadata. More...
 

Public Types

enum class  Type { Begin , Update , End , Cancel }
 Enumeration of reasons for the event. More...
 
- Public Types inherited from InputEvent
enum class  KeyboardModifier {
  None = 0 , Shift = 1 << 0 , Control = 1 << 1 , Alt = 1 << 2 ,
  Meta = 1 << 3
}
 Bitfield enumeration to describe modifier keys on the keyboard. More...
 
using LocalToGlobalCoordMapping = std::function<vec2(const vec2&)>
 Typedef for a function to map from event coordinates to global coordinates if applicable.
 

Public Member Functions

 TouchEvent (Type type, std::vector< Point > points, Flags< KeyboardModifier > modifiers=KeyboardModifier::None, LocalToGlobalCoordMapping mappingFunction=nullptr)
 Constructor for a TouchEvent.
 
Type type () const
 Returns the reason for emitting this event.
 
const std::vector< Point > & points () const
 Returns the list of touch points comprising this event.
 
- Public Member Functions inherited from InputEvent
 InputEvent (Flags< KeyboardModifier > modifiers, LocalToGlobalCoordMapping mappingFunction=nullptr)
 Constructor for the InputEvent base class.
 
const KeyEventasKeyEvent () const
 Convenience function to dynamic_cast this instance to a KeyEvent.
 
const MouseEventasMouseEvent () const
 Convenience function to dynamic_cast this instance to a MouseEvent.
 
const TouchEventasTouchEvent () const
 Convenience function to dynamic_cast this instance to a TouchEvent.
 
const ContextMenuEventasContextMenuEvent () const
 Convenience function to dynamic_cast this instance to a ContextMenuEvent.
 
const Flags< KeyboardModifier > & modifiers () const
 Returns the list of pressed keyboard modifier keys.
 
vec2 mapToGlobalCoord (const vec2 &localCoord) const
 Converts the given localCoord to the global coordinate system of the underlying windowing system if applicable.
 
const LocalToGlobalCoordMappinglocalToGlobalMappingFunction () const
 

Additional Inherited Members

- Protected Attributes inherited from InputEvent
Flags< KeyboardModifierm_modifiers = KeyboardModifier::None
 
LocalToGlobalCoordMapping m_localToGlobalMappingFunction
 

Member Enumeration Documentation

◆ Type

enum class Type
strong

Enumeration of reasons for the event.

Enumerator
Begin 

A touch gesture has just started.

Update 

The state of the touch points of a previously started touch gesture has changed.

End 

A touch gesture has been completed.

Cancel 

A touch gesture was aborted by the user requesting to ignore the entire touch sequence.

Constructor & Destructor Documentation

◆ TouchEvent()

TouchEvent ( Type type,
std::vector< Point > points,
Flags< KeyboardModifier > modifiers = KeyboardModifier::None,
LocalToGlobalCoordMapping mappingFunction = nullptr )

Constructor for a TouchEvent.

Parameters
typeReason for emitting this event.
pointsList of touch points comprising this event.
modifiersList of pressed keyboard modifier keys.
mappingFunctionOptional mapping function used by mapToGlobalCoord() to convert event coordinates to global coordinates if the underlying windowing system supports it; mapToGlobalCoord() will use the identity function if empty.

The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close