LuciadCPillar 2024.0.08
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
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
 Returns whether the button is the left mouse button. More...
 
constexpr bool isMiddle () const
 Returns whether the button is the middle mouse button. More...
 
constexpr bool isRight () const
 Returns whether the button is the right mouse button. More...
 
constexpr bool isUnknown () const
 Returns whether the button is unknown. More...
 
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 whether the button is the left mouse button.

Returns
whether the button is the left mouse button.

◆ isMiddle()

constexpr bool luciad::MouseButton::isMiddle ( ) const
inlineconstexpr

Returns whether the button is the middle mouse button.

Returns
whether the button is the middle mouse button.

◆ isRight()

constexpr bool luciad::MouseButton::isRight ( ) const
inlineconstexpr

Returns whether the button is the right mouse button.

Returns
whether the button is the right mouse button.

◆ isUnknown()

constexpr bool luciad::MouseButton::isUnknown ( ) const
inlineconstexpr

Returns whether the button is unknown.

Returns
whether 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.