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

#include <JoystickEvent.h>

JoystickEvent Class. More...

Inheritance diagram for sofa::core::objectmodel::JoystickEvent:

Detailed Description

Classes

class  AxisEvent
 Implements an event that notifies about axis positions (like analog controls of a joystick). The axis position is normalized so values are always in the range [-1, 1]. More...
 
class  ButtonEvent
 Implements the button event for joysticks. More...
 
class  HatEvent
 Implements an event notifiying changes about a directionnal hat on a device (like a joystick). More...
 

Public Member Functions

Axis
const AxisEventgetAxisEvent (const int) const
 
const std::vector< AxisEvent * > & getAxisEvents (void) const
 
unsigned int getAxisEventsSize (void) const
 
void addAxisEvent (AxisEvent *)
 
Button
ButtonEventgetButtonEvent (void) const
 
bool getButton (unsigned int) const
 
void setButtonEvent (ButtonEvent *)
 
- Public Member Functions inherited from sofa::core::objectmodel::Event
 Event ()
 
virtual ~Event ()
 
void setHandled ()
 Tag the event as handled, i.e. the event needs not be propagated further. More...
 
bool isHandled () const
 Returns true of the event has been handled. More...
 
virtual const chargetClassName () const
 
virtual size_t getEventTypeIndex () const =0
 

Hat

std::vector< AxisEvent * > axisEvents
 State of the Analogic Pad. More...
 
ButtonEventbuttonEvent
 State of the Joystick Buttons. More...
 
std::vector< HatEvent * > hatEvents
 State of the directional cross. More...
 
const HatEventgetHatEvent (const int) const
 
const std::vector< HatEvent * > & getHatEvents (void) const
 
unsigned int getHatEventsSize (void) const
 
void addHatEvent (HatEvent *)
 
 JoystickEvent ()
 default constructor. More...
 
 ~JoystickEvent () override
 default destructor. More...
 
static const charGetClassName ()
 

Additional Inherited Members

- Protected Attributes inherited from sofa::core::objectmodel::Event
bool m_handled
 
- Static Protected Attributes inherited from sofa::core::objectmodel::Event
static size_t s_lastEventTypeIndex = 0
 storing the last given id More...
 
- Static Public Member Functions inherited from sofa::core::objectmodel::Event
static const charGetClassName ()
 
static size_t getEventTypeCount ()
 

Attribute details

◆ axisEvents

std::vector< AxisEvent* > sofa::core::objectmodel::JoystickEvent::axisEvents
protected

State of the Analogic Pad.

◆ buttonEvent

ButtonEvent* sofa::core::objectmodel::JoystickEvent::buttonEvent
protected

State of the Joystick Buttons.

◆ hatEvents

std::vector< HatEvent* > sofa::core::objectmodel::JoystickEvent::hatEvents
protected

State of the directional cross.

Constructor details

◆ JoystickEvent()

sofa::core::objectmodel::JoystickEvent::JoystickEvent ( )

default constructor.

◆ ~JoystickEvent()

sofa::core::objectmodel::JoystickEvent::~JoystickEvent ( )
override

default destructor.

Function details

◆ addAxisEvent()

void sofa::core::objectmodel::JoystickEvent::addAxisEvent ( JoystickEvent::AxisEvent aEvent)

◆ addHatEvent()

void sofa::core::objectmodel::JoystickEvent::addHatEvent ( JoystickEvent::HatEvent hEvent)

◆ getAxisEvent()

const JoystickEvent::AxisEvent * sofa::core::objectmodel::JoystickEvent::getAxisEvent ( const int  index) const

◆ getAxisEvents()

const std::vector< JoystickEvent::AxisEvent * > & sofa::core::objectmodel::JoystickEvent::getAxisEvents ( void  ) const

◆ getAxisEventsSize()

unsigned int sofa::core::objectmodel::JoystickEvent::getAxisEventsSize ( void  ) const

◆ getButton()

bool sofa::core::objectmodel::JoystickEvent::getButton ( unsigned int  buttonIndex) const

◆ getButtonEvent()

JoystickEvent::ButtonEvent * sofa::core::objectmodel::JoystickEvent::getButtonEvent ( void  ) const

◆ GetClassName()

static const char* sofa::core::objectmodel::JoystickEvent::GetClassName ( )
inlinestatic

◆ getHatEvent()

const JoystickEvent::HatEvent * sofa::core::objectmodel::JoystickEvent::getHatEvent ( const int  index) const

◆ getHatEvents()

const std::vector< JoystickEvent::HatEvent * > & sofa::core::objectmodel::JoystickEvent::getHatEvents ( void  ) const

◆ getHatEventsSize()

unsigned int sofa::core::objectmodel::JoystickEvent::getHatEventsSize ( void  ) const

◆ setButtonEvent()

void sofa::core::objectmodel::JoystickEvent::setButtonEvent ( JoystickEvent::ButtonEvent bEvent)