hedgewars/uUtils.pas
changeset 14901 63357ed39886
parent 14900 d4a19bf6687e
child 14951 23fc5022bdea
--- a/hedgewars/uUtils.pas	Tue May 07 13:56:11 2019 +0200
+++ b/hedgewars/uUtils.pas	Tue May 07 14:17:09 2019 +0200
@@ -84,6 +84,7 @@
 function CalcWorldWrap(X, radius: LongInt): LongInt;
 
 procedure updateVolumeDelta(precise: boolean);
+procedure updateCursorMovementDelta(precise: boolean; dir: LongInt; var cursorVar: LongInt);
 
 function read1stLn(filePath: shortstring): shortstring;
 function readValueFromINI(key, filePath: shortstring): shortstring;
@@ -717,6 +718,23 @@
     cVolumeDelta:= 0;
 end;
 
+// helper function for cursor movement change controls
+procedure updateCursorMovementDelta(precise: boolean; dir: LongInt; var cursorVar: LongInt);
+begin
+if dir > 0 then
+    if precise then
+        cursorVar:= cameraKeyboardSpeedSlow
+    else
+        cursorVar:= cameraKeyboardSpeed
+else if dir < 0 then
+    if precise then
+        cursorVar:= - cameraKeyboardSpeedSlow
+    else
+        cursorVar:= - cameraKeyboardSpeed
+else
+    cursorVar:= 0;
+end;
+
 function read1stLn(filePath: shortstring): shortstring;
 var f: pfsFile;
 begin