igor::iMouse Class Reference

#include <iMouse.h>

Inherits igor::iOSEventListener, and igor::iModule< iMouse >.

Public Member Functions

void setCenter ()
 
void setPosition (int32 x, int32 y)
 
void setPosition (const iaVector2i &pos)
 
void hideCursor (bool hide)
 
void setCursor (iMouseCursorType cursorType)
 
void resetCursor ()
 
const iaVector2igetPos () const
 
iaVector2i getPosDelta () const
 
bool getRightButton ()
 
bool getLeftButton ()
 
bool getMiddleButton ()
 
bool getButton4 ()
 
bool getButton5 ()
 
iWindowPtr getWindow () const override
 
- Public Member Functions inherited from igor::iOSEventListener
 iOSEventListener ()=default
 
virtual ~iOSEventListener ()=default
 
virtual iWindowPtr getWindow () const =0
 

Friends

class iModule< iMouse >
 

Additional Inherited Members

- Static Public Member Functions inherited from igor::iModule< iMouse >
static IGOR_INLINE iMousegetInstance ()
 
static IGOR_INLINE bool isInstantiated ()
 
static void create ()
 
static void destroy ()
 
- Protected Member Functions inherited from igor::iModule< iMouse >
 iModule ()=default
 
virtual ~iModule ()=default
 

Detailed Description

Mouse (Singleton)

Member Function Documentation

◆ getButton4()

bool igor::iMouse::getButton4 ( )
Returns
true: mouse button 4 is pressed; false: mouse button 4 is not pressed

◆ getButton5()

bool igor::iMouse::getButton5 ( )
Returns
true: mouse button 5 is pressed; false: mouse button 5 is not pressed

◆ getLeftButton()

bool igor::iMouse::getLeftButton ( )
Returns
true: left mouse button is pressed; false: left mouse button is not pressed

◆ getMiddleButton()

bool igor::iMouse::getMiddleButton ( )
Returns
true: middle mouse button is pressed; false: middle mouse button is not pressed

◆ getPos()

const iaVector2i & igor::iMouse::getPos ( ) const
Returns
the current mouse position relative to the parent window in pixel.

origin is top left

◆ getPosDelta()

iaVector2i igor::iMouse::getPosDelta ( ) const
Returns
the delta mouse movement since last mouse update.

◆ getRightButton()

bool igor::iMouse::getRightButton ( )
Returns
true: right mouse button is pressed; false: right mouse button is not pressed

◆ getWindow()

iWindowPtr igor::iMouse::getWindow ( ) const
overridevirtual
Returns
pointer to corresponding window

If it returns nullptr the listener was not registered to a window yet

Implements igor::iOSEventListener.

◆ hideCursor()

void igor::iMouse::hideCursor ( bool  hide)

switches the cursor on or off

Parameters
showtrue: cursor is visible; false: cursor is invisible

◆ resetCursor()

void igor::iMouse::resetCursor ( )

resets cursor type to default

◆ setCenter()

void igor::iMouse::setCenter ( )

set mouse to center of currently focused window

Parameters
suppressMoveEventif true suppress next mouse event

◆ setCursor()

void igor::iMouse::setCursor ( iMouseCursorType  cursorType)

sets cursor type

Parameters
cursorTypethe cursor type to set

◆ setPosition() [1/2]

void igor::iMouse::setPosition ( const iaVector2i pos)

set mouse to a position relative to currently focussed window

Parameters
poshorizontal and vertical position of the mouse cursor in pixel

◆ setPosition() [2/2]

void igor::iMouse::setPosition ( int32  x,
int32  y 
)

set mouse to a position relative to currently focussed window

Parameters
xhorizontal position of the mouse cursor in pixel
yvertical position of the mouse cursor in pixel

Friends And Related Function Documentation

◆ iModule< iMouse >

friend class iModule< iMouse >
friend

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