SOFA API  c76874b7
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...
 
virtual const char * getClassName () const
 
Accessors
int getIndex () const
 Retrieves the index of the hat. More...
 
State getState () const
 Retrieves the state of the hat. More...
 

Constructor details

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

Constructor.

Parameters
indexthe hat's index
statethe hat's state
sofa::core::objectmodel::JoystickEvent::HatEvent::~HatEvent ( )
virtual

Default destructor.

Function details

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

Retrieves the index of the hat.

Returns
the hat's index
JoystickEvent::HatEvent::State sofa::core::objectmodel::JoystickEvent::HatEvent::getState ( ) const

Retrieves the state of the hat.

Returns
the hat's state

Enum details

Defines possible hat states.

Enumerator
CENTERED 
UP 
RIGHT 
DOWN 
LEFT 
UP_RIGHT 
DOWN_RIGHT 
DOWN_LEFT 
UP_LEFT