Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
rtc
Joystick
js.h
Go to the documentation of this file.
1
#include <vector>
2
#ifdef __APPLE__
3
#include "
ysjoyreader.h
"
4
#endif
5
6
class
joystick
7
{
8
public
:
9
typedef
enum
{
EVENT_AXIS
,
EVENT_BUTTON
,
EVENT_NONE
}
event
;
10
joystick
(
const
char
*dev);
11
~joystick
();
12
bool
readEvent
();
13
bool
getButtonState
(
int
i_index)
const
{
return
m_buttons
[i_index]; }
14
float
getAxisState
(
int
i_index)
const
{
return
m_axes
[i_index]; }
15
bool
is_open
()
const
{
return
m_fd
>= 0; }
16
unsigned
int
nButtons
()
const
{
return
m_buttons
.size(); }
17
unsigned
int
nAxes
()
const
{
return
m_axes
.size(); }
18
private
:
19
int
m_fd
;
20
std::vector<float>
m_axes
;
21
std::vector<bool>
m_buttons
;
22
#ifdef __APPLE__
23
#define maxNumJoystick 4
24
YsJoyReader
m_dev[maxNumJoystick];
25
#endif
26
};
joystick::m_buttons
std::vector< bool > m_buttons
Definition:
js.h:21
joystick::m_fd
int m_fd
Definition:
js.h:19
joystick::readEvent
bool readEvent()
Definition:
js.cpp:40
YsJoyReader
Definition:
ysjoyreader.h:63
joystick::getButtonState
bool getButtonState(int i_index) const
Definition:
js.h:13
joystick::joystick
joystick(const char *dev)
Definition:
js.cpp:10
joystick::EVENT_NONE
Definition:
js.h:9
joystick::~joystick
~joystick()
Definition:
js.cpp:33
joystick::nAxes
unsigned int nAxes() const
Definition:
js.h:17
joystick
Definition:
js.h:6
joystick::EVENT_AXIS
Definition:
js.h:9
joystick::EVENT_BUTTON
Definition:
js.h:9
joystick::m_axes
std::vector< float > m_axes
Definition:
js.h:20
joystick::is_open
bool is_open() const
Definition:
js.h:15
ysjoyreader.h
joystick::getAxisState
float getAxisState(int i_index) const
Definition:
js.h:14
joystick::event
event
Definition:
js.h:9
joystick::nButtons
unsigned int nButtons() const
Definition:
js.h:16
hrpsys
Author(s): AIST, Fumio Kanehiro
autogenerated on Thu May 6 2021 02:41:50