Ocean
Ocean::Platform::Win::Mouse Class Reference

This class implements mouse functionalities. More...

Inheritance diagram for Ocean::Platform::Win::Mouse:

Static Public Member Functions

static bool allButtonsDown (const Button buttons, const bool synchron=true)
 Returns whether all specified buttons of the mouse are currently pushed (down) or not. More...
 
static bool oneButtonDown (const Button buttons, const bool synchron=true)
 Returns whether at least one button of the specified buttons of the mouse is currently pushed (down) or not. More...
 
static bool isButtonDown (const Button button, const bool synchron=true)
 Returns wheater exactly one (specified button) is currently pushed (down) or not. More...
 
static Button currentMouseButtonState (const bool synchron=true)
 Returns the current mouse button state for the left, middle and right mouse button. More...
 
static VectorI2 screenPosition ()
 Returns the current position of the mouse (cursor) in screen coordinates. More...
 

Static Protected Member Functions

static bool keyState (const int nVirtualKey, const bool synchron)
 Returns wheater exactly one (specified mouse button) is currently pushed (down) or not. More...
 

Additional Inherited Members

- Private Types inherited from Ocean::Platform::Mouse
enum  Button {
  BUTTON_NONE = 0 , BUTTON_LEFT = (1 << 0) , BUTTON_MIDDLE = (1 << 1) , BUTTON_RIGHT = (1 << 2) ,
  BUTTON_LAST_UNIQUE_VALUE = (1 << 2)
}
 Definition of individual mouse buttons. More...
 
- Static Private Member Functions inherited from Ocean::Platform::Mouse
static bool allButtonsDown (const Button buttons, const bool synchron=true)
 Returns whether all specified buttons of the mouse are currently pushed (down) or not. More...
 
static bool oneButtonDown (const Button buttons, const bool synchron=true)
 Returns whether at least one button of the specified buttons of the mouse is currently pushed (down) or not. More...
 
static bool isButtonDown (const Button button, const bool synchron=true)
 Returns whether exactly one (specified button) is currently pushed (down) or not. More...
 
static Button currentMouseButtonState (const bool synchron=true)
 Returns the current mouse button state for the left, middle and right mouse button. More...
 
static VectorI2 screenPosition (const VectorI2 &invalidPosition=VectorI2(NumericT< int >::minValue(), NumericT< int >::minValue()))
 Returns the current position of the mouse/cursor in screen coordinates. More...
 
static bool isButtonDownWindows (const Button button, const bool synchron=true)
 Returns whether exactly one (specified button) is currently pushed (down) or not (specialization for Windows). More...
 
static bool keyStateWindows (const int nVirtualKey, const bool synchron)
 Returns whether exactly one (specified key) is currently pushed (down) or not. More...
 
static VectorI2 screenPositionWindows (const VectorI2 &invalidPosition=VectorI2(NumericT< int >::minValue(), NumericT< int >::minValue()))
 Returns the current position of the mouse/cursor in screen coordinates (specialization for Windows). More...
 
static bool isButtonDownApple (const Button button, const bool synchron=true)
 Returns whether exactly one (specified button) is currently pushed (down) or not (specialization for Apple platforms). More...
 
static VectorI2 screenPositionApple (const VectorI2 &invalidPosition=VectorI2(NumericT< int >::minValue(), NumericT< int >::minValue()))
 Returns the current position of the mouse/cursor in screen coordinates (specialization for Apple platforms). More...
 

Detailed Description

This class implements mouse functionalities.

Member Function Documentation

◆ allButtonsDown()

static bool Ocean::Platform::Win::Mouse::allButtonsDown ( const Button  buttons,
const bool  synchron = true 
)
static

Returns whether all specified buttons of the mouse are currently pushed (down) or not.

Parameters
buttonsThe buttons for that the states are requested (may be a combination of several buttons)
synchronTrue, to request the state synchronously with the message queue; False, to request the state in the current moment
Returns
True, if so; also True if no button is provided

◆ currentMouseButtonState()

static Button Ocean::Platform::Win::Mouse::currentMouseButtonState ( const bool  synchron = true)
static

Returns the current mouse button state for the left, middle and right mouse button.

Parameters
synchronTrue, to request the state synchronously with the message queue; False, to request the state in the current moment
Returns
Current mouse button state

◆ isButtonDown()

static bool Ocean::Platform::Win::Mouse::isButtonDown ( const Button  button,
const bool  synchron = true 
)
static

Returns wheater exactly one (specified button) is currently pushed (down) or not.

Parameters
buttonOne unique button for that the state is requested, must not be a combination of several buttons
synchronTrue, to request the state synchronously with the message queue; False, to request the state in the current moment
Returns
True, if so

◆ keyState()

bool Ocean::Platform::Win::Mouse::keyState ( const int  nVirtualKey,
const bool  synchron 
)
inlinestaticprotected

Returns wheater exactly one (specified mouse button) is currently pushed (down) or not.

Parameters
nVirtualKeyThe virtual key code for that the state is requested
synchronTrue, to request the state synchronously with the message queue; False, to request the state in the current moment
Returns
True, if so

◆ oneButtonDown()

static bool Ocean::Platform::Win::Mouse::oneButtonDown ( const Button  buttons,
const bool  synchron = true 
)
static

Returns whether at least one button of the specified buttons of the mouse is currently pushed (down) or not.

Parameters
buttonsThe buttons for that the states are requested (may be a combination of several buttons)
synchronTrue, to request the state synchronously with the message queue; False, to request the state in the current moment
Returns
True, if so; also True if no button is provided

◆ screenPosition()

static VectorI2 Ocean::Platform::Win::Mouse::screenPosition ( )
static

Returns the current position of the mouse (cursor) in screen coordinates.

Returns
Mouse screen coordinates

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