2 // gamepad.h: Header file
5 // (C) 2013 Underground Software
11 #define JOY_BUTTON 0x0100
12 #define JOY_HAT 0x0200
14 #define JOY_TYPE_MASK 0xFF00
15 #define JOY_HATNUM_MASK 0x00F8
16 #define JOY_HATBUT_MASK 0x0007
20 uint8_t hatMask[8] = { 1, 2, 4, 8, 16, 32, 64, 128 };
22 // buttonID is the combination of the type (BUTTON, HAT) and the button #
23 // (0-255 for buttons, 0-31 for hats). Hats also have 0-7 for a button #
24 // that corresponds to a direction.
28 // really should make all methods and members be static so that we can
29 // call this stuff without instantiating one. :-)
34 bool GetState(int joystickID, int buttonID);
35 int GetButtonID(void);
36 int GetJoystickID(void);
39 #endif // __GAMEPAD_H__