hedgewars/uMisc.pas
changeset 208 a049157d673a
parent 196 993cf173218b
child 281 5b483aa9f2ab
--- a/hedgewars/uMisc.pas	Fri Oct 27 19:37:59 2006 +0000
+++ b/hedgewars/uMisc.pas	Fri Oct 27 22:07:38 2006 +0000
@@ -100,12 +100,15 @@
 procedure AddFileLog(s: shortstring);
 function RectToStr(Rect: TSDL_Rect): shortstring;
 {$ENDIF}
+procedure SetKB(n: Longword);
+procedure SendKB;
 
 var CursorPoint: TPoint;
     TargetPoint: TPoint = (X: NoPointX; Y: 0);
 
 implementation
 uses uConsole, uStore, uIO{$IFDEF FPC}, Math{$ENDIF};
+var KBnum: Longword = 0;
 {$IFDEF DEBUGFILE}
 var f: textfile;
 {$ENDIF}
@@ -184,6 +187,21 @@
 Result:= trunc(arctan2(_dY, _dX) * MaxAngleDivPI) mod cMaxAngle
 end;
 
+procedure SetKB(n: Longword);
+begin
+KBnum:= n
+end;
+
+procedure SendKB;
+var s: shortstring;
+begin
+if KBnum <> 0 then
+   begin
+   s:= 'K' + inttostr(KBnum);
+   SendIPCRaw(@s, Length(s) + 1)
+   end
+end;
+
 {$IFDEF DEBUGFILE}
 procedure AddFileLog(s: shortstring);
 begin