utility 2026.2.0
A comprehensive C++ utilities library tailored for the development of modern desktop and extended reality (XR) applications.
Loading...
Searching...
No Matches
utility::event::HandButtonEvent Class Reference

Hand button event. More...

#include <headers/utility/event/hand_button_event.hpp>

Inheritance diagram for utility::event::HandButtonEvent:
Collaboration diagram for utility::event::HandButtonEvent:

Classes

class  Factory
 Factory for creating HandButtonEvent instances. More...
 

Public Types

enum class  Button {
  Unknown = 0 , X = 1 , Y = 2 , A = 3 ,
  B = 4 , Menu = 5 , System = 6
}
 Hand button identifier. More...
 
- Public Types inherited from utility::event::HandEvent
enum class  HandType { Unknown = 0 , Left = 1 , Right = 2 }
 Hand types for hand events. Defines the type of hand involved in the event (e.g., left or right). More...
 

Public Member Functions

 HandButtonEvent (void)
 Default constructor.
 
 ~HandButtonEvent (void) override
 Default destructor.
 
HandButtonEvent & setButton (const Button button) noexcept
 Set button value.
 
Button getButton (void) const noexcept
 Get button value.
 
bool isValidForCurrentHand (void) const noexcept
 Check whether current hand/button combination is valid.
 
HandButtonEvent & setTouched (const bool touched) noexcept
 Set touched state.
 
bool isTouched (void) const noexcept
 Get touched state.
 
HandButtonEvent & setButtonPressed (const bool clicked) noexcept
 Set clicked state.
 
bool isButtonPressed (void) const noexcept
 Get clicked state.
 
- Public Member Functions inherited from utility::event::HandEvent
 HandEvent (void)
 Default constructor.
 
virtual ~HandEvent (void) override
 Default destructor.
 
HandEvent & setHandType (const HandType handType) noexcept
 Set the type of hand involved in the event.
 
HandType getHandType (void) const noexcept
 Get the type of hand involved in the event.
 
HandEvent & setPose (const graphic::PoseF &pose) noexcept
 Set the pose of the hand.
 
graphic::PoseF getPose (void) const noexcept
 Get the pose of the hand.
 
HandEvent & setAim (const graphic::PoseF &aim) noexcept
 Set aim pose.
 
graphic::PoseF getAim (void) const noexcept
 Get aim pose.
 
HandEvent & setGrip (const graphic::PoseF &grip) noexcept
 Set grip pose.
 
graphic::PoseF getGrip (void) const noexcept
 Get grip pose.
 
HandEvent & setGripSurface (const graphic::PoseF &gripSurface) noexcept
 Set grip_surface pose.
 
graphic::PoseF getGripSurface (void) const noexcept
 Get grip_surface pose.
 
- Public Member Functions inherited from utility::event::Event
 Event (void)=default
 Default constructor.
 
virtual ~Event (void)=default
 Virtual destructor.
 

Static Public Member Functions

static bool isButtonValidForHand (const HandType handType, const Button button) noexcept
 Check whether a button is valid for a given hand path.
 

Detailed Description

Hand button event.

Definition at line 36 of file hand_button_event.hpp.

Member Enumeration Documentation

◆ Button

Hand button identifier.

Enumerator
Unknown 

Unknown button

X 

X button

Y 

Y button

A 

A button

B 

B button

Menu 

Menu button

System 

System button

Definition at line 42 of file hand_button_event.hpp.

Member Function Documentation

◆ getButton()

HandButtonEvent::Button utility::event::HandButtonEvent::getButton ( void  ) const
noexcept

Get button value.

Returns
Current button.

Definition at line 66 of file hand_button_event.cpp.

◆ isButtonPressed()

bool utility::event::HandButtonEvent::isButtonPressed ( void  ) const
noexcept

Get clicked state.

Returns
True if clicked.

Definition at line 94 of file hand_button_event.cpp.

◆ isButtonValidForHand()

bool utility::event::HandButtonEvent::isButtonValidForHand ( const HandType  handType,
const Button  button 
)
staticnoexcept

Check whether a button is valid for a given hand path.

Parameters
handTypeHand side.
buttonButton identifier.
Returns
True when the button is valid for that hand.

Definition at line 28 of file hand_button_event.cpp.

Here is the caller graph for this function:

◆ isTouched()

bool utility::event::HandButtonEvent::isTouched ( void  ) const
noexcept

Get touched state.

Returns
True if touched.

Definition at line 82 of file hand_button_event.cpp.

◆ isValidForCurrentHand()

bool utility::event::HandButtonEvent::isValidForCurrentHand ( void  ) const
noexcept

Check whether current hand/button combination is valid.

Returns
True when current button is valid for current hand type.

Definition at line 71 of file hand_button_event.cpp.

Here is the call graph for this function:

◆ setButton()

HandButtonEvent & utility::event::HandButtonEvent::setButton ( const Button  button)
noexcept

Set button value.

Parameters
buttonHand button.
Returns
Reference to this HandButtonEvent.

Definition at line 60 of file hand_button_event.cpp.

◆ setButtonPressed()

HandButtonEvent & utility::event::HandButtonEvent::setButtonPressed ( const bool  clicked)
noexcept

Set clicked state.

Parameters
clickedTrue if clicked.
Returns
Reference to this HandButtonEvent.

Definition at line 88 of file hand_button_event.cpp.

◆ setTouched()

HandButtonEvent & utility::event::HandButtonEvent::setTouched ( const bool  touched)
noexcept

Set touched state.

Parameters
touchedTrue if touched.
Returns
Reference to this HandButtonEvent.

Definition at line 76 of file hand_button_event.cpp.


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