# HG changeset patch # User Anton Malmygin # Date 1455482041 -3600 # Node ID 45982bda46cc5a9dc81167136594265d79952f92 # Parent 2bbbe9cb29808a37fc6f55c0383ee84ea4bacd52 Fix for cursor movement problems on touch devices diff -r 2bbbe9cb2980 -r 45982bda46cc 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: