]>
git.defcon.no Git - joysticktest/blob - joystickthread.h
1 #ifndef JOYSTICKTHREAD_H
2 #define JOYSTICKTHREAD_H
5 #include "joystickdata.h"
7 #define JS_EVENT_BUTTON 0x01 /* button pressed/released */
8 #define JS_EVENT_AXIS 0x02 /* joystick moved */
9 #define JS_EVENT_INIT 0x80 /* initial state of device */
10 #define JS_EVENT_AXISENUM 0x81 /* enumeration of available axis */
11 #define JS_EVENT_BUTTONENUM 0x81 /* enumeration of available buttons */
14 unsigned int time
; /* event timestamp in milliseconds */
15 short value
; /* value */
16 unsigned char type
; /* event type */
17 unsigned char number
; /* axis/button number */
20 class JoystickThread
: public QThread
24 int open_joystick(char *joystick_device
);
25 int read_joystick_event(struct js_event
*jse
);
32 JoystickThread(JoystickData
*jd
, const QString device
);
37 #endif // JOYSTICKTHREAD_H