Choreonoid  1.8
Public Types | Public Member Functions | Friends | List of all members
cnoid::Joystick Class Reference

#include <Joystick.h>

Inheritance diagram for cnoid::Joystick:
cnoid::JoystickInterface

Public Types

enum  AxisID {
  L_STICK_H_AXIS, L_STICK_V_AXIS, R_STICK_H_AXIS, R_STICK_V_AXIS,
  DIRECTIONAL_PAD_H_AXIS, DIRECTIONAL_PAD_V_AXIS, L_TRIGGER_AXIS, R_TRIGGER_AXIS,
  NUM_STD_AXES
}
 
enum  ButtonID {
  A_BUTTON, B_BUTTON, X_BUTTON, Y_BUTTON,
  L_BUTTON, R_BUTTON, SELECT_BUTTON, START_BUTTON,
  L_STICK_BUTTON, R_STICK_BUTTON, LOGO_BUTTON, NUM_STD_BUTTONS
}
 

Public Member Functions

 Joystick ()
 
 Joystick (const char *device)
 
virtual ~Joystick ()
 
std::string device () const
 
int fileDescriptor () const
 
bool makeReady ()
 
bool isReady () const
 
const char * errorMessage () const
 
virtual int numAxes () const override
 
virtual int numButtons () const override
 
virtual bool readCurrentState () override
 
virtual double getPosition (int axis) const override
 
virtual bool getButtonState (int button) const override
 
void setAxisEnabled (int axis, bool on)
 
bool isActive () const
 
SignalProxy< void(int id, bool isPressed)> sigButton ()
 
SignalProxy< void(int id, double position)> sigAxis ()
 

Friends

class JoystickImpl
 

Member Enumeration Documentation

◆ AxisID

Enumerator
L_STICK_H_AXIS 
L_STICK_V_AXIS 
R_STICK_H_AXIS 
R_STICK_V_AXIS 
DIRECTIONAL_PAD_H_AXIS 
DIRECTIONAL_PAD_V_AXIS 
L_TRIGGER_AXIS 
R_TRIGGER_AXIS 
NUM_STD_AXES 

◆ ButtonID

Enumerator
A_BUTTON 
B_BUTTON 
X_BUTTON 
Y_BUTTON 
L_BUTTON 
R_BUTTON 
SELECT_BUTTON 
START_BUTTON 
L_STICK_BUTTON 
R_STICK_BUTTON 
LOGO_BUTTON 
NUM_STD_BUTTONS 

Constructor & Destructor Documentation

◆ Joystick() [1/2]

Joystick::Joystick ( )

◆ Joystick() [2/2]

Joystick::Joystick ( const char *  device)

◆ ~Joystick()

Joystick::~Joystick ( )
virtual

Member Function Documentation

◆ device()

std::string Joystick::device ( ) const

◆ errorMessage()

const char * Joystick::errorMessage ( ) const

◆ fileDescriptor()

int Joystick::fileDescriptor ( ) const

◆ getButtonState()

bool Joystick::getButtonState ( int  button) const
overridevirtual

◆ getPosition()

double Joystick::getPosition ( int  axis) const
overridevirtual

◆ isActive()

bool Joystick::isActive ( ) const

◆ isReady()

bool Joystick::isReady ( ) const

◆ makeReady()

bool Joystick::makeReady ( )

◆ numAxes()

int Joystick::numAxes ( ) const
overridevirtual

◆ numButtons()

int Joystick::numButtons ( ) const
overridevirtual

◆ readCurrentState()

bool Joystick::readCurrentState ( )
overridevirtual

◆ setAxisEnabled()

void Joystick::setAxisEnabled ( int  axis,
bool  on 
)

◆ sigAxis()

SignalProxy< void(int id, double position)> Joystick::sigAxis ( )

◆ sigButton()

SignalProxy< void(int id, bool isPressed)> Joystick::sigButton ( )

Friends And Related Function Documentation

◆ JoystickImpl

friend class JoystickImpl
friend

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