32 #ifndef _CLASS_GAMEPAD_H_
33 #define _CLASS_GAMEPAD_H_
35 #include <linux/joystick.h>
97 void (*callback)(
int value,
void*data);
void plerr(int ret)
Print local error function This function prints the error present in the err variable (this is a priv...
int Dispatch(bool debug=false)
This function checks the gamepad status and calls the respective callback.
~class_gamepad()
Class destructor.
class_gamepad()
Class constructor.
int GetButtonMapping(void)
Get the button mapping from the device.
int SetButtonMapping(void)
Set the button mapping to the device.
int RegisterCallback(e_type type, int id, void(*callback)(int value, void *data), void *data)
Register a callback for a specific button or axis.
int UnRegisterCallback(e_type type, int id)
int StartComm(const char *device)
Initialize comm with the gamepad.
__u16 m_buttons[KEY_MAX-BTN_MISC+1]