--- a/hedgewars/uInputHandler.pas Tue Apr 16 00:07:15 2019 +0300
+++ b/hedgewars/uInputHandler.pas Thu Apr 18 19:44:25 2019 +0200
@@ -32,7 +32,8 @@
function KeyBindToName(bind: shortstring): shortstring;
//procedure MaskModifier(var code: LongInt; modifier: LongWord);
procedure MaskModifier(Modifier: shortstring; var code: LongInt);
-procedure ProcessMouse(event: TSDL_MouseButtonEvent; ButtonDown: boolean);
+procedure ProcessMouseButton(event: TSDL_MouseButtonEvent; ButtonDown: boolean);
+procedure ProcessMouseMotion(xrel, yrel: LongInt);
//procedure ProcessMouseWheel(x, y: LongInt);
procedure ProcessMouseWheel(y: LongInt);
procedure ProcessKey(event: TSDL_KeyboardEvent); inline;
@@ -59,7 +60,7 @@
procedure ControllerButtonEvent(joy, button: Byte; pressed: Boolean);
implementation
-uses uConsole, uCommands, uVariables, uConsts, uUtils, uDebug, uPhysFSLayer;
+uses uConsole, uCommands, uVariables, uConsts, uUtils, uDebug, uPhysFSLayer, uCursor;
const
LSHIFT = $0200;
@@ -278,7 +279,7 @@
ProcessKey(code, event.type_ = SDL_KEYDOWN);
end;
-procedure ProcessMouse(event: TSDL_MouseButtonEvent; ButtonDown: boolean);
+procedure ProcessMouseButton(event: TSDL_MouseButtonEvent; ButtonDown: boolean);
begin
//writelntoconsole('[MOUSE] '+inttostr(event.button));
case event.button of
@@ -291,6 +292,11 @@
end;
end;
+procedure ProcessMouseMotion(xrel, yrel: LongInt);
+begin
+ uCursor.updatePositionDelta(xrel, yrel);
+end;
+
var mwheelupCode, mwheeldownCode: Integer;
//procedure ProcessMouseWheel(x, y: LongInt);