sincerely Singaporean

If you have not done so, read this full tutorial on how to use SGEXTN to build an application.

SGXTouchEvent

see header file

see source file

class SGXTouchEvent;

part of SGEXTN module SG_Widgets

represents touch event

detailed description

list of all including inherited members

implementation details

preprocessor file inclusion directive: #include ‹SGXTouchEvent.h›

CMake target for BuildLah: SGEXTN::SG_Widgets

see this link for more information about BuildLah

parent class: (none)

children classes: (none)

instance member variables

enum TouchPhase{ TouchStart, TouchOngoing, TouchEnd };

float differenceX;

float differenceY;

float force;

int id;

SGXTouchEvent::TouchPhase phase;

float previousX;

float previousY;

float radius;

float startX;

float startY;

float velocityX;

float velocityY;

float x;

float y;

instance member functions

[[nodiscard]] int hash() const;

[[nodiscard]] bool operator!=(SGXTouchEvent x) const;

[[nodiscard]] bool operator‹(SGXTouchEvent x) const;

[[nodiscard]] bool operator==(SGXTouchEvent x) const;

[[nodiscard]] bool operator›(SGXTouchEvent x) const;

Detailed Description

SGXTouchEvent returns a touch event received by SGWSingleTouchReceiver or a SGWMultiTouchReceiver. This is passed to the corresponding callback function ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ to allow custom interactions.

Implementation Details

Contains information about the touch event.

enum TouchPhase{ TouchStart, TouchOngoing, TouchEnd };

Indicates the type of touch event. The phase is TouchStart when the finger contacts the screen for the first time, TouchOngoing if the finger is moved while in contact with the screen, and TouchEnd when the finger is not in contact.

float differenceX;

Difference in x coordinate between the SGXTouchEvent this frame and the corresponding SGXTouchEvent last frame.

float differenceY;

Difference in y coordinate between the SGXTouchEvent this frame and the corresponding SGXTouchEvent last frame.

float force;

Force of the user pressing their finger against the screen.

This is always between 0 and 1.

This may not be available on some devices.

int id;

Index of the SGXTouchEvent.

The same touch event is guaranteed to have the same index across different frames.

SGXTouchEvent::TouchPhase phase;

Phase of the SGXTouchEvent.

float previousX;

X coordinate of the corresponding SGXTouchEvent last frame.

float previousY;

Y coordinate of the corresponding SGXTouchEvent last frame.

float radius;

Radius of contact point in pixels.

This can be used for palm detection.

float startX;

X coordinate of the SGXTouchEvent on the first frame when the finger touched the screen.

float startY;

Y coordinate of the SGXTouchEvent on the first frame when the finger touched the screen.

float velocityX;

X direction of the speed of the user moving their finger across the screen in pixels per second.

This may not be available on some devices.

float velocityY;

Y direction of the speed of the user moving their finger across the screen in pixels per second.

This may not be available on some devices.

float x;

X coordinate in pixels of the SGXTouchEvent.

float y;

Y coordinate in pixels of the SGXTouchEvent.

[[nodiscard]] int hash() const;

Hash function for SGLHash.

This only takes into account the index number, comparing SGXTouchEvent from different touch receivers is undefined behaviour.

[[nodiscard]] bool operator!=(SGXTouchEvent x) const;

Inequality check with x for SGLEqualsTo.

This only takes into account the index number, comparing SGXTouchEvent from different touch receivers is undefined behaviour.

[[nodiscard]] bool operator‹(SGXTouchEvent x) const;

Lesser than operator with x for SGLLesserThan and SGLMoreThan.

This only takes into account the index number, comparing SGXTouchEvent from different touch receivers is undefined behaviour.

[[nodiscard]] bool operator==(SGXTouchEvent x) const;

Equality check with x for SGLEqualsTo.

This only takes into account the index number, comparing SGXTouchEvent from different touch receivers is undefined behaviour.

[[nodiscard]] bool operator›(SGXTouchEvent x) const;

More than operator with x for SGLLesserThan and SGLMoreThan.

This only takes into account the index number, comparing SGXTouchEvent from different touch receivers is undefined behaviour.

©2025 05524F.sg (Singapore)

contact 05524F / report a bug / make a suggestion

about 05524F SINGAPORE values

list of 05524F projects