class GUIMouseEvent

Contains data about a GUI mouse input event.

This class may store data for many types of events, and some data might not be initialized for some event types. Caller must check event type before relying on the data inside.

Public

Constructors

GUIMouseEvent

GUIMouseEvent() = default

GUIMouseEvent

GUIMouseEvent(bool buttonStates[3], bool shift, bool ctrl, bool alt)

Methods

GetPosition

const GUIPhysicalPoint &GetPosition() const

The position of the mouse when the event happened.

This is relative to the parent widget of the element this event is being sent to.

GetType

GUIMouseEventType GetType() const

Returns the internal type of the event.

GetButton

GUIMouseButton GetButton() const

Returns the mouse button involved in the event, if any.

GetDragAmount

GUIPhysicalPoint GetDragAmount() const

Returns drag amount in pixels, if event is drag related.

GetDragStartPosition

GUIPhysicalPoint GetDragStartPosition() const

Returns the position where the drag was started from, if event is drag related.

GetWheelScrollAmount

float GetWheelScrollAmount() const

Returns amount of mouse wheel scroll, if event is scroll wheel related.

IsButtonDown

bool IsButtonDown(GUIMouseButton button) const

Checks is the specified mouse button pressed.

GetDragAndDropData

const SPtr<DragAndDropData> &GetDragAndDropData() const

Returns data being dragged by a drag and drop event.

Only valid if event is drag and drop related.

IsShiftDown

bool IsShiftDown() const

Checks is the shift button being held.

IsCtrlDown

bool IsCtrlDown() const

Checks is the control button being held.

IsAltDown

bool IsAltDown() const

Checks is the alt button being held.

Private

Methods

SetMouseOverData

void SetMouseOverData(const GUIPhysicalPoint &position)

Initializes the event with MouseOver event data.

SetMouseOutData

void SetMouseOutData(const GUIPhysicalPoint &position)

Initializes the event with MouseOut event data.

SetMouseMoveData

void SetMouseMoveData(const GUIPhysicalPoint &position)

Initializes the event with MouseMove event data.

SetMouseWheelScrollData

void SetMouseWheelScrollData(float scrollAmount)

Initializes the event with MouseWheelScroll event data.

SetMouseUpData

void SetMouseUpData(const GUIPhysicalPoint &position, GUIMouseButton button)

Initializes the event with MouseUp event data.

SetMouseDownData

void SetMouseDownData(const GUIPhysicalPoint &position, GUIMouseButton button)

Initializes the event with MouseDown event data.

SetMouseDoubleClickData

void SetMouseDoubleClickData(const GUIPhysicalPoint &position, GUIMouseButton button)

Initializes the event with MouseDoubleClick event data.

SetMouseDragData

void SetMouseDragData(const GUIPhysicalPoint &position, const GUIPhysicalPoint &dragAmount)

Initializes the event with MouseDrag event data.

SetMouseDragStartData

void SetMouseDragStartData(const GUIPhysicalPoint &position, const GUIPhysicalPoint &dragStartPosition)

Initializes the event with MouseDragStart event data.

SetMouseDragEndData

void SetMouseDragEndData(const GUIPhysicalPoint &position)

Initializes the event with MouseDragEnd event data.

SetDragAndDropDroppedData

void SetDragAndDropDroppedData(const GUIPhysicalPoint &position, const SPtr<DragAndDropData> &dragAndDropData)

Initializes the event with DragAndDropDropped event data.

SetDragAndDropDraggedData

void SetDragAndDropDraggedData(const GUIPhysicalPoint &position, const SPtr<DragAndDropData> &dragAndDropData)

Initializes the event with DragAndDropDragged event data.

SetDragAndDropLeftData

void SetDragAndDropLeftData(const GUIPhysicalPoint &position, const SPtr<DragAndDropData> &dragAndDropData)

Initializes the event with DragAndDropLeft event data.

Fields

mButtonStates

bool[3] mButtonStates

mPosition

GUIPhysicalPoint mPosition

mDragStartPosition

GUIPhysicalPoint mDragStartPosition

mDragAmount

GUIPhysicalPoint mDragAmount

mWheelScrollAmount

float mWheelScrollAmount

mType

mButton

mDragAndDropData

SPtr<DragAndDropData> mDragAndDropData

mShift

bool mShift

mCtrl

bool mCtrl

mAlt

bool mAlt