Blender  V2.93
Public Member Functions | Public Attributes | List of all members
GHOST_Buttons Struct Reference

#include <GHOST_Buttons.h>

Public Member Functions

 GHOST_Buttons ()
 
 ~GHOST_Buttons ()
 
bool get (GHOST_TButtonMask mask) const
 
void set (GHOST_TButtonMask mask, bool down)
 
void clear ()
 

Public Attributes

GHOST_TUns8 m_ButtonLeft: 1
 
GHOST_TUns8 m_ButtonMiddle: 1
 
GHOST_TUns8 m_ButtonRight: 1
 

Detailed Description

This struct stores the state of the mouse buttons. Buttons can be set using button masks.

Definition at line 33 of file GHOST_Buttons.h.

Constructor & Destructor Documentation

◆ GHOST_Buttons()

GHOST_Buttons::GHOST_Buttons ( )

Constructor.

Definition at line 26 of file GHOST_Buttons.cpp.

References clear().

◆ ~GHOST_Buttons()

GHOST_Buttons::~GHOST_Buttons ( )

Definition at line 69 of file GHOST_Buttons.cpp.

Member Function Documentation

◆ clear()

void GHOST_Buttons::clear ( void  )

Sets the state of all buttons to up.

Definition at line 62 of file GHOST_Buttons.cpp.

References m_ButtonLeft, m_ButtonMiddle, and m_ButtonRight.

Referenced by GHOST_SystemCocoa::getButtons(), and GHOST_Buttons().

◆ get()

bool GHOST_Buttons::get ( GHOST_TButtonMask  mask) const

Returns the state of a single button.

Parameters
maskKey button to return.
Returns
The state of the button (pressed == true).

Definition at line 31 of file GHOST_Buttons.cpp.

References GHOST_kButtonMaskLeft, GHOST_kButtonMaskMiddle, GHOST_kButtonMaskRight, m_ButtonLeft, m_ButtonMiddle, m_ButtonRight, and mask().

Referenced by GHOST_System::getButtonState().

◆ set()

void GHOST_Buttons::set ( GHOST_TButtonMask  mask,
bool  down 
)

Updates the state of a single button.

Parameters
maskButton state to update.
downThe new state of the button.

Definition at line 45 of file GHOST_Buttons.cpp.

References GHOST_kButtonMaskLeft, GHOST_kButtonMaskMiddle, GHOST_kButtonMaskRight, m_ButtonLeft, m_ButtonMiddle, m_ButtonRight, and mask().

Referenced by GHOST_SystemCocoa::getButtons(), GHOST_SystemSDL::getButtons(), GHOST_SystemWin32::getButtons(), GHOST_SystemX11::getButtons(), and pointer_button().

Member Data Documentation

◆ m_ButtonLeft

GHOST_TUns8 GHOST_Buttons::m_ButtonLeft

Definition at line 60 of file GHOST_Buttons.h.

Referenced by clear(), get(), and set().

◆ m_ButtonMiddle

GHOST_TUns8 GHOST_Buttons::m_ButtonMiddle

Definition at line 61 of file GHOST_Buttons.h.

Referenced by clear(), get(), and set().

◆ m_ButtonRight

GHOST_TUns8 GHOST_Buttons::m_ButtonRight

Definition at line 62 of file GHOST_Buttons.h.

Referenced by clear(), get(), and set().


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