LuciadCPillar 2023.1.04
luciad::MouseButton Struct Reference

Represents a mouse button in the controller API. More...

#include <luciad/input/mouse/MouseButton.h>

Public Member Functions

constexpr MouseButton (size_t index)
 Creates a new MouseButton with the given index. More...
 
constexpr bool isLeft () const
 
constexpr bool isMiddle () const
 
constexpr bool isRight () const
 
constexpr bool isUnknown () const
 
constexpr bool operator!= (const MouseButton &rhs) const
 
constexpr bool operator== (const MouseButton &rhs) const
 

Static Public Member Functions

static const MouseButtonleft ()
 Returns the left mouse button. More...
 
static const MouseButtonmiddle ()
 Returns the middle mouse button. More...
 
static const MouseButtonright ()
 Returns the right mouse button. More...
 
static const MouseButtonunknown ()
 Returns an unknown mouse button. More...
 

Public Attributes

size_t index
 The mouse button index. More...
 

Detailed Description

Represents a mouse button in the controller API.

Since
2020.1

Constructor & Destructor Documentation

◆ MouseButton()

constexpr luciad::MouseButton::MouseButton ( size_t  index)
inlineexplicitconstexpr

Creates a new MouseButton with the given index.

The mouse button index maps to mouse buttons as follows:

  • 0 => unknown button
  • 1 => left mouse button (primary button)
  • 2 => middle mouse button
  • 3 => right mouse button

Unmapped values can be used to express a custom mouse button.

Parameters
indexthe mouse button index.

Member Function Documentation

◆ isLeft()

constexpr bool luciad::MouseButton::isLeft ( ) const
inlineconstexpr
Returns
if the button is the left mouse button

◆ isMiddle()

constexpr bool luciad::MouseButton::isMiddle ( ) const
inlineconstexpr
Returns
if the button is the middle mouse button

◆ isRight()

constexpr bool luciad::MouseButton::isRight ( ) const
inlineconstexpr
Returns
if the button is the right mouse button

◆ isUnknown()

constexpr bool luciad::MouseButton::isUnknown ( ) const
inlineconstexpr
Returns
if the button is unknown

◆ left()

static const MouseButton & luciad::MouseButton::left ( )
static

Returns the left mouse button.

Returns
the left mouse button.

◆ middle()

static const MouseButton & luciad::MouseButton::middle ( )
static

Returns the middle mouse button.

Returns
the middle mouse button.

◆ operator!=()

constexpr bool luciad::MouseButton::operator!= ( const MouseButton rhs) const
inlineconstexpr
Parameters
rhsthe MouseButton that this MouseButton is being compared to.
Returns
true if the MouseButtons are not equal

◆ operator==()

constexpr bool luciad::MouseButton::operator== ( const MouseButton rhs) const
inlineconstexpr
Parameters
rhsthe MouseButton that this MouseButton is being compared to.
Returns
true if the MouseButtons are equal

◆ right()

static const MouseButton & luciad::MouseButton::right ( )
static

Returns the right mouse button.

Returns
the right mouse button.

◆ unknown()

static const MouseButton & luciad::MouseButton::unknown ( )
static

Returns an unknown mouse button.

Returns
an unknown mouse button.

Member Data Documentation

◆ index

size_t luciad::MouseButton::index

The mouse button index.