added stopping text input when pressing joystick button
authorHolger Schemel <info@artsoft.org>
Sat, 29 Dec 2018 01:00:51 +0000 (02:00 +0100)
committerHolger Schemel <info@artsoft.org>
Sat, 29 Dec 2018 01:00:51 +0000 (02:00 +0100)
src/events.c

index 3346055722afa7566fa7f249ade02584d18a4f15..7b2ba984732b8fa857478f9bfc44d26d9259d041 100644 (file)
@@ -2360,6 +2360,16 @@ void HandleJoystick(void)
     return;
   }
 
+  if (newbutton && (game_status == GAME_MODE_PSEUDO_TYPENAME ||
+                   anyTextGadgetActive()))
+  {
+    // leave name input in main menu or text input gadget
+    HandleKey(KSYM_Escape, KEY_PRESSED);
+    HandleKey(KSYM_Escape, KEY_RELEASED);
+
+    return;
+  }
+
   if (level.game_engine_type == GAME_ENGINE_TYPE_MM)
   {
     if (game_status == GAME_MODE_PLAYING)