added option 'off' for touch controls (for non-Android platforms)
[rocksndiamonds.git] / src / events.c
index 0fd37032ba306f436f8be3ebcc0a4edb79a8f00c..c7707c2f6f9fcc7c3904003cac863a518fd66243 100644 (file)
@@ -676,7 +676,7 @@ void HandleFingerEvent(FingerEvent *event)
   if (game_status != GAME_MODE_PLAYING)
     return;
 
-  if (strEqual(setup.touch.control_type, TOUCH_CONTROL_FOLLOW_FINGER))
+  if (strEqual(setup.touch.control_type, TOUCH_CONTROL_OFF))
     return;
 
   if (strEqual(setup.touch.control_type, TOUCH_CONTROL_VIRTUAL_BUTTONS))
@@ -824,6 +824,9 @@ void HandleFingerEvent(FingerEvent *event)
     return;
   }
 
+  if (!strEqual(setup.touch.control_type, TOUCH_CONTROL_WIPE_GESTURES))
+    return;
+
   // use touch direction control
 
   if (event->type == EVENT_FINGERPRESS)
@@ -1931,6 +1934,15 @@ void HandleKey(Key key, int key_status)
 void HandleNoEvent()
 {
   HandleMouseCursor();
+
+  switch (game_status)
+  {
+#if defined(TARGET_SDL2)
+    case GAME_MODE_PLAYING:
+      HandleFollowFinger(-1, -1, -1);
+      break;
+#endif
+  }
 }
 
 void HandleEventActions()
@@ -1962,12 +1974,6 @@ void HandleEventActions()
       HandleLevelEditorIdle();
       break;
 
-#if defined(TARGET_SDL2)
-    case GAME_MODE_PLAYING:
-      HandleFollowFinger(-1, -1, -1);
-      break;
-#endif
-
     default:
       break;
   }