2 // gamepad.cpp - Host joystick handling (using SDL)
5 // (C) 2013 Underground Software
7 // JLH = James Hammons <jlhamm@acm.org>
10 // --- ---------- -------------------------------------------------------------
11 // JLH 01/05/2013 Created this file
17 bool Gamepad::GetState(int joystickID, int buttonID)
19 if (buttonID & JOY_BUTTON)
23 else if (buttonID & JOY_HAT)
26 int hatNumber = (buttonID & JOY_HATNUM_MASK) >> 3;
27 int hatDirection = hatMask[buttonID & JOY_HATBUT_MASK];
35 int Gamepad::GetButtonID(void)
37 // Return single button ID being pressed (if any)
41 int Gamepad::GetJoystickID(void)
43 // Return joystick ID of button being pressed (if any)