struct MAGES::Interaction::TrackedDeviceModel::ButtonState

Overview

A struct storing the state of a button. More…

struct ButtonState
{
    // properties

    bool IsPressed;
    bool IgnoreNextClick;
    float PressTime;
    bool ClickedOnSameGameObject;
    bool WasPressedThisFrame;
    bool WasReleasedThisFrame;

    // methods

    void CopyPressStateTo(PointerEventData eventData);
    void CopyPressStateFrom(PointerEventData eventData);
};

Detailed Documentation

A struct storing the state of a button.

Properties

bool IsPressed

Gets or sets a value indicating whether this button is pressed or not.

bool IgnoreNextClick

Gets or sets a value indicating whether to ignore next click. When we “release” a button other than through user interaction (e.g. through focus switching), we don’t want this to count as an actual release that ends up clicking. This flag will cause generated events to have eligibleForClick to be false.

float PressTime

Gets or sets the time this button was pressed.

bool ClickedOnSameGameObject

Gets or sets a value indicating whether this button has clicked on the same gameobject.

bool WasPressedThisFrame

Gets or sets a value indicating whether this button was pressed this frame.

bool WasReleasedThisFrame

Gets or sets a value indicating whether this button was released this frame.

Methods

void CopyPressStateTo(PointerEventData eventData)

Copies the press state to the given event data.

Parameters:

eventData

The event data to copy the press state to.

void CopyPressStateFrom(PointerEventData eventData)

Copies the press state from the given event data.

Parameters:

eventData

The event data to copy the press state from.