split function to toggle fullscreen and change window scaling
[rocksndiamonds.git] / src / events.c
index 2678fa28b94c227855bd4f772ae5bcc57615f31c..0643e1642c3a77ff7c33ded51282c0c9b1167af1 100644 (file)
@@ -4,7 +4,7 @@
 // (c) 1995-2014 by Artsoft Entertainment
 //                         Holger Schemel
 //                 info@artsoft.org
-//                 http://www.artsoft.org/
+//                 https://www.artsoft.org/
 // ----------------------------------------------------------------------------
 // events.c
 // ============================================================================
@@ -1382,7 +1382,12 @@ static void HandleButtonOrFinger(int mx, int my, int button)
 
 static boolean checkTextInputKey(Key key)
 {
-  return (textinput_status && KSYM_PRINTABLE(key));
+  // when playing, only handle raw key events and ignore text input
+  if (game_status == GAME_MODE_PLAYING)
+    return FALSE;
+
+  // else handle all printable keys as text input
+  return KSYM_PRINTABLE(key);
 }
 
 void HandleTextEvent(TextEvent *event)
@@ -2172,7 +2177,7 @@ void HandleKey(Key key, int key_status)
   {
     setup.fullscreen = !setup.fullscreen;
 
-    ToggleFullscreenOrChangeWindowScalingIfNeeded();
+    ToggleFullscreenIfNeeded();
 
     if (game_status == GAME_MODE_SETUP)
       RedrawSetupScreenAfterFullscreenToggle();
@@ -2205,7 +2210,7 @@ void HandleKey(Key key, int key_status)
     else if (setup.window_scaling_percent > MAX_WINDOW_SCALING_PERCENT)
       setup.window_scaling_percent = MAX_WINDOW_SCALING_PERCENT;
 
-    ToggleFullscreenOrChangeWindowScalingIfNeeded();
+    ChangeWindowScalingIfNeeded();
 
     if (game_status == GAME_MODE_SETUP)
       RedrawSetupScreenAfterFullscreenToggle();