Fix for cursor movement problems on touch devices
authorAnton Malmygin <antonc27@mail.ru>
Sun, 14 Feb 2016 21:34:01 +0100
changeset 11553 45982bda46cc
parent 11552 2bbbe9cb2980
child 11554 893722a2a1f9
Fix for cursor movement problems on touch devices
hedgewars/hwengine.pas
--- a/hedgewars/hwengine.pas	Sun Feb 14 20:57:17 2016 +0300
+++ b/hedgewars/hwengine.pas	Sun Feb 14 21:34:01 2016 +0100
@@ -183,21 +183,6 @@
                     if (GameState <> gsChat) and (GameState >= gsGame) then
                         ProcessKey(event.key);
 
-                SDL_MOUSEBUTTONDOWN:
-                    if GameState = gsConfirm then
-                        ParseCommand('quit', true)
-                    else
-                        if (GameState >= gsGame) then ProcessMouse(event.button, true);
-
-                SDL_MOUSEBUTTONUP:
-                    if (GameState >= gsGame) then ProcessMouse(event.button, false);
-
-                SDL_MOUSEWHEEL:
-                    begin
-                    wheelEvent:= true;
-                    ProcessMouseWheel(event.wheel.x, event.wheel.y);
-                    end;
-
                 SDL_TEXTINPUT: if GameState = gsChat then uChat.TextInput(event.text);
 
                 SDL_WINDOWEVENT:
@@ -244,7 +229,23 @@
 
                 SDL_FINGERUP:
                     onTouchUp(event.tfinger.x, event.tfinger.y, event.tfinger.fingerId);
+{$ELSE}
+                SDL_MOUSEBUTTONDOWN:
+                    if GameState = gsConfirm then
+                        ParseCommand('quit', true)
+                    else
+                        if (GameState >= gsGame) then ProcessMouse(event.button, true);
+
+                SDL_MOUSEBUTTONUP:
+                    if (GameState >= gsGame) then ProcessMouse(event.button, false);
+
+                SDL_MOUSEWHEEL:
+                    begin
+                    wheelEvent:= true;
+                    ProcessMouseWheel(event.wheel.x, event.wheel.y);
+                    end;
 {$ENDIF}
+
                 SDL_JOYAXISMOTION:
                     ControllerAxisEvent(event.jaxis.which, event.jaxis.axis, event.jaxis.value);
                 SDL_JOYHATMOTION: