MouseEvent

class HPS::MouseEvent : public HPS::InputEvent

The MouseEvent class is the event generated for each mouse action.

Public Types

enum Action

Enumeration of various actions a mouse can undergo for a MouseEvent.

Values:

enumerator ButtonUp
enumerator ButtonDown

A mouse button has been released.

enumerator Move

A mouse button has been pressed.

enumerator Scroll

The mouse location has changed.

enumerator Enter

The scroll wheel has been moved.

enumerator Leave

The mouse cursor has moved into the active window.

The mouse cursor has moved out of the active window.

Public Functions

inline virtual Event *Clone() const

Allocates and returns a copy of this MouseEvent.

Returns

A copy of this MouseEvent.

inline virtual bool Drop(Event const *in_that_event) const

Determines if this MouseEvent can be dropped in favor of the following mouse event.

Parameters

in_that_eventEvent to compare with this MouseEvent.

Returns

true if this event can be dropped, false otherwise.

inline virtual bool Equals(InputEvent 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 Equals(MouseEvent 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 intptr_t Freshen() const

This optional function is used to determine if the current event can be dropped in favor of newer event of the same type if one is available.

Returns

A cookie representing the freshen category. Zero indicates a non-freshening event.

inline MouseEvent()

The default constructor creates an uninitialized MouseEvent object.

inline MouseEvent(Action in_action, float in_wheel_delta, WindowPoint in_location = WindowPoint(0, 0, 0), ModifierKeys in_modifier = ModifierKeys(), size_t in_click_count = 0)

This constructor creates a MouseEvent object, most useful for a wheel action.

Parameters
  • in_action – Action of the mouse for this MouseEvent.

  • in_wheel_delta – If the action involves the mouse wheel, this is the amount the wheel moved. It is positive if the mouse wheel is moved forward (away from the user) or negative if the mouse wheel is moved downward (toward the user).

  • in_location – The location in window space of the mouse cursor.

  • in_modifier – The modifier keys for this MouseEvent.

  • in_click_count – The number of clicks received.

inline MouseEvent(Action in_action, WindowPoint in_location, MouseButtons in_button = MouseButtons(), ModifierKeys in_modifier = ModifierKeys(), size_t in_click_count = 0)

This constructor creates a MouseEvent object for a given action.

Parameters
  • in_action – Action of this MouseEvent.

  • in_location – The location in window space of the mouse cursor.

  • in_button – If the action is a button event, this is the button.

  • in_modifier – The modifier keys for this MouseEvent.

  • in_click_count – The number of clicks received.

inline MouseEvent(Event const &in_event)

This constructor converts an Event Object to a MouseEvent object.

Parameters

in_event – The Event Object to be converted.

inline virtual bool operator!=(MouseEvent 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==(MouseEvent 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.

~MouseEvent()

Public Members

size_t ClickCount

The number of clicks received.

HPS::MouseEvent::Action CurrentAction

The action for this MouseEvent.

HPS::MouseButtons CurrentButton

If the action involves a button, this is the button.

WindowPoint Location

Location in window space of the mouse cursor.

float WheelDelta

If the action involves the mouse wheel, this is the amount the wheel moved. It is positive if the mouse wheel is moved forward (away from the user) or negative if the mouse wheel is moved downward (toward the user).