TouchEvent

class TouchEvent : public HPS::InputEvent

The TouchEvent class is the event generated for each touch action on a multi-touch device.

Public Types

enum class Action : uint32_t

Enumeration of various actions touches can undergo for a TouchEvent.

Values:

enumerator TouchDown

A touch, or touches, has just gone down.

enumerator TouchUp

A touch, or touches, has just gone up.

enumerator Move

A touch, or touches, has just moved.

Public Functions

inline virtual char const *ClassName() const override
inline virtual Event *Clone() const override

Allocates and returns a copy of this TouchEvent.

Returns:A copy of this TouchEvent.
inline virtual bool Drop(Event const *in_that_event) const override

Determines if this TouchEvent can be dropped in favor of the following touch event.

Parameters:in_that_eventEvent to compare with this TouchEvent.
Returns:true if this event can be dropped, false otherwise.
inline virtual bool Equals(InputEvent const &in_that) const override

Check if the source object is equivalent to this object.

Parameters:in_that – The source object to compare to this object.
Returns:true if the objects are equivalent, false otherwise.
inline bool Equals(TouchEvent const &in_that) const

Check if the source object is equivalent to this object.

Parameters:in_that – The source object to compare to this object.
Returns:true if the objects are equivalent, false otherwise.
inline virtual bool operator!=(TouchEvent const &in_that) const

Check if the source object is not equivalent to this object.

Parameters:in_kit – The source object to compare to this object.
Returns:true if the objects are not equivalent, false otherwise.
inline virtual bool operator==(TouchEvent const &in_that) const

Check if the source object is equivalent to this object.

Parameters:in_kit – The source object to compare to this object.
Returns:true if the objects are equivalent, false otherwise.
inline TouchEvent()

The default constructor creates an uninitialized TouchEvent object.

inline TouchEvent(Action in_action, ModifierKeys in_modifier = ModifierKeys())

This constructor creates a TouchEvent object for a given action without an array of Touches. Specifying TouchUp without an array of Touches clears tracked touches.

Parameters:
inline TouchEvent(Action in_action, size_t in_touch_count, Touch const in_touches[], ModifierKeys in_modifier = ModifierKeys())

This constructor creates a TouchEvent object for a given action with an array of Touches. Specifying TouchUp with an empty an array of Touches clears tracked touches.

Parameters:
  • in_action – Action of this TouchEvent.
  • in_touch_count – the number of Touches in the touch array.
  • in_touches – An array or touches for this TouchEvent.
  • in_modifier – The modifier keys for this TouchEvent.
inline TouchEvent(Action in_action, TouchArray const &in_touches, ModifierKeys in_modifier = ModifierKeys())

This constructor creates a TouchEvent object for a given action with an array of Touches. Specifying TouchUp with an empty an array of Touches clears tracked touches.

Parameters:
  • in_action – Action of this TouchEvent.
  • in_touches – An array or touches for this TouchEvent.
  • in_modifier – The modifier keys for this TouchEvent.
inline TouchEvent(Event const &in_event)

This constructor converts an Event Object to a TouchEvent object.

Parameters:in_event – The Event Object to be converted.
~TouchEvent()

Public Members

HPS::TouchEvent::Action CurrentAction

The action for the touches of this TouchEvent.

HPS::TouchArray Touches

Array of Touches for this TouchEvent.