주요 내용으로 건너뛰기

ClickEvent

touchgfx/events/ClickEvent.hpp

A click event. The semantics of this event is slightly depending on hardware platform. ClickEvents are generated by the HAL layer.

See: Event

Inherits from: Event

Public Types

enumClickEventType { PRESSED, RELEASED, CANCEL }
Values that represent click event types.

Public Functions

ClickEvent(ClickEventType type, int16_t x, int16_t y, int16_t force =0)
Initializes a new instance of the ClickEvent class.
ClickEvent(const ClickEvent & clickEvent)
Copy constructor.
virtual Event::EventTypegetEventType() const
Gets event type.
int16_tgetForce() const
Gets the force of the click.
ClickEventTypegetType() const
Gets the click type of this event.
int16_tgetX() const
Gets the x coordinate of this event.
int16_tgetY() const
Gets the y coordinate of this event.
const ClickEvent &operator=(const ClickEvent & clickEvent)
Assignment operator.
voidsetType(ClickEventType type)
Sets the click type of this event.
voidsetX(int16_t x)
Sets the x coordinate of this event.
voidsetY(int16_t y)
Sets the y coordinate of this event.

Additional inherited members

Public Types inherited from Event

enumEventType { EVENT_CLICK, EVENT_DRAG, EVENT_GESTURE }
The event types.

Public Functions inherited from Event

Event()
Default constructor.
virtual ~Event()
Destructor.

Public Types Documentation

ClickEventType

Values that represent click event types.

PRESSEDAn enum constant representing the pressed option.
RELEASEDAn enum constant representing the released option.
CANCELAn enum constant representing the cancel option.

Public Functions Documentation

ClickEvent

ClickEvent(ClickEventTypetype ,
int16_tx ,
int16_ty ,
int16_tforce =0
)

Initializes a new instance of the ClickEvent class.

Parameters:
typeThe type of the click event.
xThe x coordinate of the click event.
yThe y coordinate of the click event.
force(Optional) The force of the click. On touch displays this usually means how hard the user pressed on the display. On the windows platform, this will always be zero.

ClickEvent

ClickEvent(const ClickEvent &clickEvent)

Copy constructor.

Parameters:
clickEventThe click event.

getEventType

virtual Event::EventType getEventType()const

Gets event type.

Returns:

The type of this event.

Reimplements: touchgfx::Event::getEventType

getForce

int16_t getForce()const

Gets the force of the click.

On touch displays this usually means how hard the user pressed on the display. On the windows platform, this will always be zero.

Returns:

The force of the click.

getType

ClickEventType getType()const

Gets the click type of this event.

Returns:

The click type of this event.

getX

int16_t getX()const

Gets the x coordinate of this event.

Returns:

The x coordinate of this event.

getY

int16_t getY()const

Gets the y coordinate of this event.

Returns:

The y coordinate of this event.

operator=

const ClickEvent & operator=(const ClickEvent &clickEvent)

Assignment operator.

Parameters:
clickEventThe click event.
Returns:

A shallow copy of this object.

setType

Sets the click type of this event.

Parameters:
typeThe type to set.

setX

void setX(int16_tx)

Sets the x coordinate of this event.

Parameters:
xThe x coordinate of this event.

setY

void setY(int16_ty)

Sets the y coordinate of this event.

Parameters:
yThe y coordinate of this event.