#include <hps.h>

Inheritance diagram for HPS::MouseState:
HPS::Object

Public Member Functions

void Assign (MouseState const &in_that)
 
bool Equals (MouseState const &in_that) const
 
HPS::MouseEvent GetActiveEvent () const
 
MouseButtons GetButtons () const
 
HPS::KeyArray GetEventPath () const
 
HPS::WindowKey GetEventSource () const
 
WindowPoint GetLocation () const
 
ModifierKeys GetModifierKeys () const
 
bool HasAll (MouseButtons in_mouse_trigger, ModifierKeys in_modifier_trigger) const
 
 MouseState ()
 
 MouseState (MouseState const &in_that)
 
 MouseState (MouseState &&in_that)
 
HPS::Type ObjectType () const
 
bool operator!= (MouseState const &in_that) const
 
MouseStateoperator= (MouseState &&in_that)
 
MouseStateoperator= (MouseState const &in_that)
 
bool operator== (MouseState const &in_that) const
 
void Set (KeyArray const &in_path, MouseEvent const &in_event, WindowPoint const &in_point, MouseButtons in_buttons=MouseButtons(), ModifierKeys in_modifiers=ModifierKeys())
 
void SetActiveEvent (MouseEvent const &in_event)
 
void SetButtons (MouseButtons in_buttons)
 
void SetEventPath (KeyArray const &in_path)
 
void SetLocation (WindowPoint const &in_point)
 
void SetModifierKeys (ModifierKeys in_modifiers)
 
- Public Member Functions inherited from HPS::Object
virtual bool Empty () const
 
intptr_t GetClassID () const
 
intptr_t GetInstanceID () const
 
bool HasType (HPS::Type in_mask) const
 
 Object (Object const &that)
 
 Object (Object &&in_that)
 
Objectoperator= (Object const &other_object)
 
Objectoperator= (Object &&in_that)
 
virtual void Reset ()
 
virtual HPS::Type Type () const
 

Static Public Attributes

static const HPS::Type staticType = HPS::Type::MouseState
 
- Static Public Attributes inherited from HPS::Object
static const HPS::Type staticType = HPS::Type::None
 

Additional Inherited Members

- Static Public Member Functions inherited from HPS::Object
template<typename T >
static intptr_t ClassID ()
 

Detailed Description

The MouseState class represents the state of the mouse or similar pointer device for a particular event.

Constructor & Destructor Documentation

◆ MouseState() [1/3]

HPS::MouseState::MouseState ( )

The default constructor creates an empty MouseState object.

◆ MouseState() [2/3]

HPS::MouseState::MouseState ( MouseState const &  in_that)

The copy constructor creates a new MouseState object that contains the same settings as the source MouseState.

Parameters
in_thatThe source MouseState to copy.

◆ MouseState() [3/3]

HPS::MouseState::MouseState ( MouseState &&  in_that)

The move constructor creates a MouseState by transferring the underlying impl of the rvalue reference to this MouseState thereby avoiding a copy and allocation.

Parameters
in_thatAn rvalue reference to a MouseState to take the impl from.

Member Function Documentation

◆ Assign()

void HPS::MouseState::Assign ( MouseState const &  in_that)

Copies the source MouseState into this MouseState.

Parameters
in_thatThe source MouseState to copy.

◆ Equals()

bool HPS::MouseState::Equals ( MouseState const &  in_that) const

Check if the source MouseState is equivalent to this MouseState.

Parameters
in_kitThe source MouseState to compare to this MouseState.
Returns
true if the objects are equivalent, false otherwise.

◆ GetActiveEvent()

HPS::MouseEvent HPS::MouseState::GetActiveEvent ( ) const

Get the active event for this MouseState. This will throw an exception if there is no active action for this MouseState.

Returns
The action for this MouseState.

◆ GetButtons()

MouseButtons HPS::MouseState::GetButtons ( ) const

Get the current state of the mouse buttons immediately after the active event.

Returns
The state of the mouse buttons.

◆ GetEventPath()

HPS::KeyArray HPS::MouseState::GetEventPath ( ) const

Get the relevant list of keys up to the window which had focus when the mouse represented by this MouseState underwent the active action. This will throw an exception if there is no event path for this MouseState.

Returns
The relevant list of keys up to the window which had focus when the mouse event represented by this MouseState underwent the active action.

◆ GetEventSource()

HPS::WindowKey HPS::MouseState::GetEventSource ( ) const

Get the window which had focus when the mouse represented by this MouseState underwent the active action. This will throw an exception if there is no event source for this MouseState.

Returns
The window which had focus when the mouse represented by this MouseState underwent the active action.

◆ GetLocation()

WindowPoint HPS::MouseState::GetLocation ( ) const

Get the current mouse position.

Returns
The location, in window space of the mouse cursor.

◆ GetModifierKeys()

ModifierKeys HPS::MouseState::GetModifierKeys ( ) const

Get an object representing the state of modifier keys for this MouseState.

Returns
An object representing the state of modifier keys.

◆ HasAll()

bool HPS::MouseState::HasAll ( MouseButtons  in_mouse_trigger,
ModifierKeys  in_modifier_trigger 
) const

Checks if this MouseState has all of the specified properties.

Parameters
in_mouse_triggerThe mouse button properties to test for.
in_modifier_triggerThe modifier keys properties to test for.
Returns
true if this MouseState has all of the specified properties, false otherwise.

◆ ObjectType()

HPS::Type HPS::MouseState::ObjectType ( ) const
inlinevirtual

This function returns the type the object, as declared (if the object is derived, this does not give the true type of the derived object).

Returns
The declared type of the object in question, which may differ from the true, underlying type.

Reimplemented from HPS::Object.

◆ operator!=()

bool HPS::MouseState::operator!= ( MouseState const &  in_that) const

Check if the source MouseState is not equivalent to this MouseState.

Parameters
in_kitThe source MouseState to compare to this MouseState.
Returns
true if the objects are not equivalent, false otherwise.

◆ operator=() [1/2]

MouseState& HPS::MouseState::operator= ( MouseState &&  in_that)

The move assignment operator transfers the underlying impl of the rvalue reference to this MouseState thereby avoiding a copy.

Parameters
in_thatAn rvalue reference to a MouseState to take the impl from.
Returns
A reference to this MouseState.

◆ operator=() [2/2]

MouseState& HPS::MouseState::operator= ( MouseState const &  in_that)

Copies the source MouseState into this MouseState.

Parameters
in_thatThe source MouseState to copy.
Returns
A reference to this MouseState.

◆ operator==()

bool HPS::MouseState::operator== ( MouseState const &  in_that) const

Check if the source MouseState is equivalent to this MouseState.

Parameters
in_kitThe source MouseState to compare to this MouseState.
Returns
true if the objects are equivalent, false otherwise.

◆ Set()

void HPS::MouseState::Set ( KeyArray const &  in_path,
MouseEvent const &  in_event,
WindowPoint const &  in_point,
MouseButtons  in_buttons = MouseButtons(),
ModifierKeys  in_modifiers = ModifierKeys() 
)

Sets the properties of this MouseState.

Parameters
in_pathThe list of keys up to the window which had focus for this mouse event.
in_eventThe mouse event.
in_pointThe location, in window space of the mouse cursor for this mouse event.
in_buttonsThe state of the mouse buttons immediately after this mouse event.
in_modifiersThe state of modifier keys for this mouse event.

◆ SetActiveEvent()

void HPS::MouseState::SetActiveEvent ( MouseEvent const &  in_event)

Sets the active event for this MouseState.

Parameters
in_eventThe action for this MouseState.

◆ SetButtons()

void HPS::MouseState::SetButtons ( MouseButtons  in_buttons)

Sets the current state of the mouse buttons immediately after the active event.

Parameters
in_buttonsThe state of the mouse buttons.

◆ SetEventPath()

void HPS::MouseState::SetEventPath ( KeyArray const &  in_path)

Sets the relevant list of keys up to the window which had focus for this mouse event.

Parameters
in_pathThe relevant list of keys up to the window which had focus when the mouse event represented by this MouseState underwent the active action.

◆ SetLocation()

void HPS::MouseState::SetLocation ( WindowPoint const &  in_point)

Sets the current mouse position.

Parameters
in_pointThe location, in window space of the mouse cursor.

◆ SetModifierKeys()

void HPS::MouseState::SetModifierKeys ( ModifierKeys  in_modifiers)

Sets an object representing the state of modifier keys for this MouseState.

Parameters
in_modifiersAn object representing the state of modifier keys.

The documentation for this class was generated from the following file: