fix key mapping for opendingux platforms
authorkub <derkub@gmail.com>
Tue, 27 Oct 2020 17:10:41 +0000 (18:10 +0100)
committerkub <derkub@gmail.com>
Tue, 27 Oct 2020 17:10:41 +0000 (18:10 +0100)
platform/opendingux/inputmap.c

index 388d5e0..660fd5f 100644 (file)
@@ -6,7 +6,7 @@
 #include "../common/input_pico.h"
 
 const struct in_default_bind in_sdl_defbinds[] = {
-       { SDLK_UP,              IN_BINDTYPE_PLAYER12, GBTN_UP },
+       { SDLK_UP,      IN_BINDTYPE_PLAYER12, GBTN_UP },
        { SDLK_DOWN,    IN_BINDTYPE_PLAYER12, GBTN_DOWN },
        { SDLK_LEFT,    IN_BINDTYPE_PLAYER12, GBTN_LEFT },
        { SDLK_RIGHT,   IN_BINDTYPE_PLAYER12, GBTN_RIGHT },
@@ -37,7 +37,6 @@ const struct menu_keymap in_sdl_key_map[] =
        { SDLK_BACKSPACE,       PBTN_R },
 };
 
-#if !defined(__RG350__)
 const char * const in_sdl_key_names[SDLK_LAST] = {
        [SDLK_UP] = "UP",
        [SDLK_DOWN] = "DOWN",
@@ -45,42 +44,31 @@ const char * const in_sdl_key_names[SDLK_LAST] = {
        [SDLK_RIGHT] = "RIGHT",
        [SDLK_LCTRL] = "A",
        [SDLK_LALT] = "B",
+#ifdef __GCW0__
        [SDLK_LSHIFT] = "X",
        [SDLK_SPACE] = "Y",
-       [SDLK_TAB] = "L",
-       [SDLK_BACKSPACE] = "R",
+#else
+       [SDLK_LSHIFT] = "Y",
+       [SDLK_SPACE] = "X",
+#endif
        [SDLK_RETURN] = "START",
        [SDLK_ESCAPE] = "SELECT",
-       [SDLK_POWER] = "POWER",
-       [SDLK_PAUSE] = "LOCK",
 
+#ifdef __RG350__
+       [SDLK_HOME] = "POWER",
+
+       [SDLK_TAB] = "L1",
+       [SDLK_BACKSPACE] = "R1",
        [SDLK_PAGEUP] = "L2",
        [SDLK_PAGEDOWN] = "R2",
        [SDLK_KP_DIVIDE] = "L3",
        [SDLK_KP_PERIOD] = "R3",
-};
 #else
-/* RG 350 */
-const char * const in_sdl_key_names[SDLK_LAST] = {
-       [SDLK_UP] = "UP",
-       [SDLK_DOWN] = "DOWN",
-       [SDLK_LEFT] = "LEFT",
-       [SDLK_RIGHT] = "RIGHT",
-       [SDLK_LCTRL] = "A",
-       [SDLK_LALT] = "B",
-       [SDLK_SPACE] = "X",
-       [SDLK_LSHIFT] = "Y",
        [SDLK_TAB] = "L",
        [SDLK_BACKSPACE] = "R",
-       [SDLK_RETURN] = "START",
-       [SDLK_ESCAPE] = "SELECT",
-       [SDLK_HOME] = "POWER",
+       [SDLK_POWER] = "POWER",
        [SDLK_PAUSE] = "LOCK",
-
-       [SDLK_PAGEUP] = "L2",
-       [SDLK_PAGEDOWN] = "R2",
-       [SDLK_KP_DIVIDE] = "L3",
-       [SDLK_KP_PERIOD] = "R3",
-};
 #endif
+};
+
 const char *const *in_sdl_key_names_p = in_sdl_key_names;