1 #ifndef ORG_EEROS_HAL_XBOX_HPP_ 2 #define ORG_EEROS_HAL_XBOX_HPP_ 6 #include <linux/joystick.h> 10 #define XBOX_BUTTON_COUNT (8) 11 #define XBOX_AXIS_COUNT (8) 26 static constexpr
int LX = 0;
27 static constexpr
int LY = 1;
28 static constexpr
int LT = 2;
29 static constexpr
int RY = 3;
30 static constexpr
int RX = 4;
31 static constexpr
int RT = 5;
32 static constexpr
int CX = 6;
33 static constexpr
int CY = 7;
36 static constexpr
int A = 0;
37 static constexpr
int B = 1;
38 static constexpr
int X = 2;
39 static constexpr
int Y = 3;
40 static constexpr
int LB = 4;
41 static constexpr
int RB = 5;
42 static constexpr
int back = 6;
43 static constexpr
int start = 7;
49 explicit XBox(std::string dev);
51 virtual void on_event(std::function<
void(
struct js_event)> action);
52 virtual void on_button(std::function<
void(
int,
bool)> action);
53 virtual void on_axis(std::function<
void(
int,
double)> action);
54 virtual std::string name();
61 virtual bool open(
const char* device);
65 std::function<void(struct js_event)> event_action;
66 std::function<void(int, bool)> button_action;
67 std::function<void(int, double)> axis_action;
73 #endif // ORG_EEROS_HAL_XBOX_HPP_ #define XBOX_AXIS_COUNT
Definition: XBox.hpp:11
static const double axis_max
Definition: XBox.hpp:21
XBoxState current
Definition: XBox.hpp:57
Definition: Config.hpp:14
bool button_up[XBOX_BUTTON_COUNT]
Definition: XBox.hpp:18
bool button_down[XBOX_BUTTON_COUNT]
Definition: XBox.hpp:19
Definition: Thread.hpp:12
XBoxState last
Definition: XBox.hpp:56
double axis[XBOX_AXIS_COUNT]
Definition: XBox.hpp:16
volatile bool running
Definition: Executor.cpp:25
bool button_state[XBOX_BUTTON_COUNT]
Definition: XBox.hpp:17
#define XBOX_BUTTON_COUNT
Definition: XBox.hpp:10