Definition at line 11 of file GameController.H.
Public Member Functions | |
| GameController (const std::string &device="/dev/input/js0") | |
| ~GameController () | |
| const std::string & | name () const |
| int | numAxes () const |
| int | numButtons () const |
| int | axis (const int number) const |
| int | axis (std::string name) |
| bool | button (const int number) const |
| bool | button (std::string name) |
| void | setAxisMap (int, std::string) |
| void | setButtonMap (int, std::string) |
| int | getAxisMapping (std::string name) |
| int | getButtonMapping (std::string name) |
Private Member Functions | |
| GameController (const GameController &controller) | |
| GameController & | operator= (const GameController &controller) |
Static Private Member Functions | |
| static void * | readThread (void *ptr) |
Private Attributes | |
| int | m_fd |
| std::string | m_name |
| int | m_axes |
| int | m_buttons |
| int | m_driver_version |
| int * | m_axis_data |
| boost::dynamic_bitset | m_button_data |
| pthread_t | m_read_thread |
| std::map< std::string, int > | buttonMap |
| std::map< std::string, int > | axisMap |
| GameController | ( | const std::string & | device = "/dev/input/js0" |
) |
Definition at line 15 of file GameController.cpp.
References WURDE::g_logdebug, m_axes, m_axis_data, m_button_data, m_buttons, m_driver_version, m_fd, m_name, m_read_thread, and readThread().
| ~GameController | ( | ) |
| GameController | ( | const GameController & | controller | ) | [private] |
| const std::string& name | ( | ) | const [inline] |
Definition at line 16 of file GameController.H.
References m_name.
Referenced by configureJoystick(), and readThread().
| int numAxes | ( | ) | const [inline] |
| int numButtons | ( | ) | const [inline] |
| int axis | ( | const int | number | ) | const [inline] |
| int axis | ( | std::string | name | ) | [inline] |
| bool button | ( | const int | number | ) | const [inline] |
Definition at line 22 of file GameController.H.
References assert_range, m_button_data, and m_buttons.
| bool button | ( | std::string | name | ) | [inline] |
| void setAxisMap | ( | int | , | |
| std::string | ||||
| ) |
Definition at line 57 of file GameController.cpp.
References axisMap, and m_axes.
Referenced by configureJoystick().
| void setButtonMap | ( | int | , | |
| std::string | ||||
| ) |
Definition at line 63 of file GameController.cpp.
References buttonMap, and m_buttons.
Referenced by configureJoystick().
| int getAxisMapping | ( | std::string | name | ) | [inline] |
| int getButtonMapping | ( | std::string | name | ) | [inline] |
| void * readThread | ( | void * | ptr | ) | [static, private] |
Definition at line 71 of file GameController.cpp.
References WURDE::g_logdebug, m_axes, m_axis_data, m_button_data, m_buttons, m_fd, and name().
Referenced by GameController().
| GameController& operator= | ( | const GameController & | controller | ) | [private] |
int m_fd [private] |
Definition at line 41 of file GameController.H.
Referenced by GameController(), readThread(), and ~GameController().
std::string m_name [private] |
int m_axes [private] |
Definition at line 45 of file GameController.H.
Referenced by axis(), GameController(), numAxes(), readThread(), and setAxisMap().
int m_buttons [private] |
Definition at line 46 of file GameController.H.
Referenced by button(), GameController(), numButtons(), readThread(), and setButtonMap().
int m_driver_version [private] |
int* m_axis_data [private] |
Definition at line 50 of file GameController.H.
Referenced by axis(), GameController(), readThread(), and ~GameController().
boost::dynamic_bitset m_button_data [private] |
Definition at line 51 of file GameController.H.
Referenced by button(), GameController(), and readThread().
pthread_t m_read_thread [private] |
std::map<std::string,int> buttonMap [private] |
Definition at line 57 of file GameController.H.
Referenced by button(), getButtonMapping(), and setButtonMap().
std::map<std::string,int> axisMap [private] |
Definition at line 58 of file GameController.H.
Referenced by axis(), getAxisMapping(), and setAxisMap().
1.5.1