SOFA API  1a4bb3e7
Open source framework for multi-physics simuation
sofa::core::objectmodel::JoystickEvent::HatEvent Class Reference

#include <JoystickEvent.h>

Implements an event notifiying changes about a directionnal hat on a device (like a joystick). More...

Detailed Description

Implements an event notifiying changes about a directionnal hat on a device (like a joystick).

Public Member Functions

 HatEvent (const int, const State)
 Constructor. More...
 
virtual ~HatEvent ()
 Default destructor. More...
 

Accessors

int getIndex () const
 Retrieves the index of the hat. More...
 
State getState () const
 Retrieves the state of the hat. More...
 
virtual const chargetClassName () const
 

Constructor details

◆ HatEvent()

sofa::core::objectmodel::JoystickEvent::HatEvent::HatEvent ( const int  index,
const State  state 
)

Constructor.

Parameters
indexthe hat's index
statethe hat's state

◆ ~HatEvent()

sofa::core::objectmodel::JoystickEvent::HatEvent::~HatEvent ( )
virtual

Default destructor.

Function details

◆ getClassName()

virtual const char* sofa::core::objectmodel::JoystickEvent::HatEvent::getClassName ( ) const
inlinevirtual

◆ getIndex()

int sofa::core::objectmodel::JoystickEvent::HatEvent::getIndex ( ) const

Retrieves the index of the hat.

Returns
the hat's index

◆ getState()

JoystickEvent::HatEvent::State sofa::core::objectmodel::JoystickEvent::HatEvent::getState ( ) const

Retrieves the state of the hat.

Returns
the hat's state

Enum details

◆ State

Defines possible hat states.

Enumerator
CENTERED 
UP 
RIGHT 
DOWN 
LEFT 
UP_RIGHT 
DOWN_RIGHT 
DOWN_LEFT 
UP_LEFT