]> Shamusworld >> Repos - virtualjaguar/blob - src/gui/gamepad.cpp
ba8a551037b044ec7b0239ab6dd0248ed63fd976
[virtualjaguar] / src / gui / gamepad.cpp
1 //
2 // gamepad.cpp - Host joystick handling (using SDL)
3 //
4 // by James Hammons
5 // (C) 2013 Underground Software
6 //
7 // JLH = James Hammons <jlhamm@acm.org>
8 //
9 // Who  When        What
10 // ---  ----------  -------------------------------------------------------------
11 // JLH  01/05/2013  Created this file
12 //
13
14 #include "gamepad.h"
15
16
17 bool Gamepad::GetState(int joystickID, int buttonID)
18 {
19         if (buttonID & JOY_BUTTON)
20         {
21                 // Handle SDL button
22         }
23         else if (buttonID & JOY_HAT)
24         {
25                 // Handle SDL hats
26                 int hatNumber = (buttonID & JOY_HATNUM_MASK) >> 3;
27                 int hatDirection = hatMask[buttonID & JOY_HATBUT_MASK];
28         }
29
30         // Default == failure
31         return false;
32 }
33
34
35 int Gamepad::GetButtonID(void)
36 {
37         // Return single button ID being pressed (if any)
38 }
39
40
41 int Gamepad::GetJoystickID(void)
42 {
43         // Return joystick ID of button being pressed (if any)
44 }
45