added support for 'select' key on certain devices (handled as 'return' key)
authorHolger Schemel <info@artsoft.org>
Sun, 16 Jul 2017 14:44:19 +0000 (16:44 +0200)
committerHolger Schemel <info@artsoft.org>
Sun, 16 Jul 2017 14:44:19 +0000 (16:44 +0200)
src/events.c
src/libgame/misc.c
src/libgame/sdl.h
src/tools.c

index 64fda8081da0fab274d5f3008bb35369d4a5f486..6671041620077893cc02078bc6a72725057c0f64 100644 (file)
@@ -1540,9 +1540,11 @@ void HandleKey(Key key, int key_status)
   int i;
 
 #if defined(TARGET_SDL2)
-  /* map special "play/pause" media key to default key for play/pause actions */
+  /* map special keys (media keys / remote control buttons) to default keys */
   if (key == KSYM_PlayPause)
     key = KSYM_space;
+  else if (key == KSYM_Select)
+    key = KSYM_Return;
 #endif
 
   HandleSpecialGameControllerKeys(key, key_status);
index 9582bdb397189765a69f88ee567dcba2c14062a6..8b37a47de807dd6dd5ff36f478fe654a927afad9 100644 (file)
@@ -1611,8 +1611,14 @@ void translate_keyname(Key *keysym, char **x11name, char **name, int mode)
     { KSYM_Page_Down,  "XK_Page_Down",         "page down" },
 
 #if defined(TARGET_SDL2)
+    { KSYM_Select,     "XK_Select",            "select" },
     { KSYM_Menu,       "XK_Menu",              "menu" },        /* menu key */
     { KSYM_Back,       "XK_Back",              "back" },        /* back key */
+    { KSYM_PlayPause,  "XK_PlayPause",         "play/pause" },
+#if defined(PLATFORM_ANDROID)
+    { KSYM_Rewind,     "XK_Rewind",            "rewind" },
+    { KSYM_FastForward,        "XK_FastForward",       "fast forward" },
+#endif
 #endif
 
     /* ASCII 0x20 to 0x40 keys (except numbers) */
index 838be3ad467ca6e96cbd5293fbb8e3428b740fe8..590dadc82d8f4a068fdc10e24f4f20d17ff20e8b 100644 (file)
@@ -199,6 +199,7 @@ struct MouseCursorInfo
 #define KSYM_Page_Down         SDLK_PAGEDOWN
 
 #if defined(TARGET_SDL2)
+#define KSYM_Select            SDLK_SELECT
 #define KSYM_Menu              SDLK_MENU
 #define KSYM_Back              SDLK_AC_BACK
 #define KSYM_PlayPause         SDLK_AUDIOPLAY
index a766c2d668f459149e2d87726a007fbe4b7708e0..1ea116bab181f892eb1280285b3203743873a9c7 100644 (file)
@@ -3912,6 +3912,7 @@ static int RequestHandleEvents(unsigned int req_state)
 
              case KSYM_Return:
 #if defined(TARGET_SDL2)
+             case KSYM_Select:
              case KSYM_Menu:
 #if defined(KSYM_Rewind)
              case KSYM_Rewind:         /* for Amazon Fire TV remote */