5#if !defined(_3DS) && !defined(_3DS_MOCK)
7typedef SDL_Keycode CST_Keycode;
9typedef int CST_Keycode;
12typedef uint16_t CST_Keymod;
17#define TOTAL_BUTTONS 18
20#define LEFT_BUTTON 0b00000000000001
21#define RIGHT_BUTTON 0b00000000000010
22#define UP_BUTTON 0b00000000000100
23#define DOWN_BUTTON 0b00000000001000
24#define START_BUTTON 0b00000000010000
25#define B_BUTTON 0b00000000100000
26#define A_BUTTON 0b00000001000000
27#define ZL_BUTTON 0b00000010000000
28#define SELECT_BUTTON 0b00000100000000
29#define L_BUTTON 0b00001000000000
30#define R_BUTTON 0b00010000000000
31#define X_BUTTON 0b00100000000000
32#define Y_BUTTON 0b01000000000000
33#define ZR_BUTTON 0b10000000000000
37#define SDL_A SDL_CONTROLLER_BUTTON_A
38#define SDL_B SDL_CONTROLLER_BUTTON_B
39#define SDL_X SDL_CONTROLLER_BUTTON_X
40#define SDL_Y SDL_CONTROLLER_BUTTON_Y
42#define SDL_PLUS SDL_CONTROLLER_BUTTON_RIGHTSHOULDER
43#define SDL_L SDL_CONTROLLER_BUTTON_START
44#define SDL_R SDL_CONTROLLER_BUTTON_LEFTSTICK
45#define SDL_ZL SDL_CONTROLLER_BUTTON_RIGHTSTICK
46#define SDL_ZR SDL_CONTROLLER_BUTTON_LEFTSHOULDER
47#define SDL_MINUS SDL_CONTROLLER_BUTTON_DPAD_UP
49#define SDL_UP SDL_CONTROLLER_BUTTON_DPAD_LEFT
51#define SDL_DOWN SDL_CONTROLLER_BUTTON_MAX
53#define SDL_DOWN SDL_CONTROLLER_BUTTON_MISC1
55#define SDL_LEFT SDL_CONTROLLER_BUTTON_DPAD_DOWN
56#define SDL_RIGHT SDL_CONTROLLER_BUTTON_DPAD_RIGHT
58#define SDL_LEFT_STICK (SDL_GameControllerButton)16
59#define SDL_UP_STICK (SDL_GameControllerButton)17
60#define SDL_RIGHT_STICK (SDL_GameControllerButton)18
61#define SDL_DOWN_STICK (SDL_GameControllerButton)19
65 unsigned int* buttons;
68 std::string controller_type;
71 GamepadInfo(
unsigned int* buttons, std::string* names, std::string prefix, std::string controller_type)
72 : buttons(buttons), names(names), prefix(prefix), controller_type(controller_type) {}
74 : buttons(
nullptr), names(
nullptr), prefix(
""), controller_type(
"")
85 bool held(
int buttons);
86 bool pressed(
int buttons);
87 bool released(
int buttons);
90 bool touchIn(
int x,
int width,
int y,
int height);
96 bool allowTouch =
true;
97 bool isScrolling =
false;
110 bool processDirectionalButtons();
111 int directionForKeycode();
112 void toggleHeldButtons();
117 CST_Keycode keyCode = -1;
121 bool held_directions[4] = {
false,
false,
false,
false };
124 int rapidFireRate = 12;
127 static bool bypassKeyEvents;
129 static std::string lastGamepadKey;
131 std::function<void()> quitaction = NULL;
133 float wheelScroll = 0;