![]() |
ImFusion SDK 4.3
|
#include <ImFusion/GUI/InputEvent.h>
Touch events occur when pressing, releasing, or moving one ore multiple touch points on a touch device. More...
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... | |
![]() | |
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. | |
![]() | |
InputEvent (Flags< KeyboardModifier > modifiers, LocalToGlobalCoordMapping mappingFunction=nullptr) | |
Constructor for the InputEvent base class. | |
const KeyEvent * | asKeyEvent () const |
Convenience function to dynamic_cast this instance to a KeyEvent. | |
const MouseEvent * | asMouseEvent () const |
Convenience function to dynamic_cast this instance to a MouseEvent. | |
const TouchEvent * | asTouchEvent () const |
Convenience function to dynamic_cast this instance to a TouchEvent. | |
const ContextMenuEvent * | asContextMenuEvent () 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 LocalToGlobalCoordMapping & | localToGlobalMappingFunction () const |
Additional Inherited Members | |
![]() | |
Flags< KeyboardModifier > | m_modifiers = KeyboardModifier::None |
LocalToGlobalCoordMapping | m_localToGlobalMappingFunction |
|
strong |
Enumeration of reasons for the event.
TouchEvent | ( | Type | type, |
std::vector< Point > | points, | ||
Flags< KeyboardModifier > | modifiers = KeyboardModifier::None, | ||
LocalToGlobalCoordMapping | mappingFunction = nullptr ) |
Constructor for a TouchEvent.
type | Reason for emitting this event. |
points | List of touch points comprising this event. |
modifiers | List of pressed keyboard modifier keys. |
mappingFunction | Optional 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. |