improved code to type player name in main menu
[rocksndiamonds.git] / src / events.c
index 69efaf508189e9631cb3b7f3b08f608f364922f5..f2f645933e6be727a2e8bb39a4637fffe4740e59 100644 (file)
@@ -408,6 +408,7 @@ void ClearEventQueue(void)
        button_status = MB_RELEASED;
        break;
 
+      case EVENT_FINGERRELEASE:
       case EVENT_KEYRELEASE:
        ClearPlayerAction();
        break;
@@ -672,19 +673,10 @@ void HandleWindowEvent(WindowEvent *event)
        // check if screen orientation has changed (should always be true here)
        if (nr != GRID_ACTIVE_NR())
        {
-         int x, y;
-
          if (game_status == GAME_MODE_SETUP)
            RedrawSetupScreenAfterScreenRotation(nr);
 
-         nr = GRID_ACTIVE_NR();
-
-         overlay.grid_xsize = setup.touch.grid_xsize[nr];
-         overlay.grid_ysize = setup.touch.grid_ysize[nr];
-
-         for (x = 0; x < MAX_GRID_XSIZE; x++)
-           for (y = 0; y < MAX_GRID_YSIZE; y++)
-             overlay.grid_button[x][y] = setup.touch.grid_button[nr][x][y];
+         SetOverlayGridSizeAndButtons();
        }
       }
     }
@@ -1757,7 +1749,7 @@ void HandleButton(int mx, int my, int button, int button_nr)
       break;
 
     case GAME_MODE_PSEUDO_TYPENAME:
-      HandleTypeName(0, KSYM_Return);
+      HandleTypeName(KSYM_Return);
       break;
 
     case GAME_MODE_LEVELS:
@@ -1898,6 +1890,10 @@ static void HandleKeysSpecial(Key key)
     {
       global.show_frames_per_second = !global.show_frames_per_second;
     }
+    else if (strSuffix(cheat_input, ":xsn"))
+    {
+      tile_cursor.xsn_debug = TRUE;
+    }
   }
   else if (game_status == GAME_MODE_PLAYING)
   {
@@ -2301,7 +2297,7 @@ void HandleKey(Key key, int key_status)
   switch (game_status)
   {
     case GAME_MODE_PSEUDO_TYPENAME:
-      HandleTypeName(0, key);
+      HandleTypeName(key);
       break;
 
     case GAME_MODE_TITLE: