hedgewars/uKeys.pas
changeset 4374 bcefeeabaa33
parent 4373 fe0e3903bb9e
child 4377 43945842da0c
--- a/hedgewars/uKeys.pas	Thu Nov 18 09:12:27 2010 +0300
+++ b/hedgewars/uKeys.pas	Thu Nov 18 11:32:47 2010 +0300
@@ -82,7 +82,7 @@
 {$ENDIF}
 {$ENDIF}
 implementation
-uses uConsole, uCommands, uMisc, uVariables, uConsts;
+uses uConsole, uCommands, uMisc, uVariables, uConsts, uUtils;
 //const KeyNumber = 1024;
 
 var tkbd, tkbdn: TKeyboardState;
@@ -193,7 +193,7 @@
 k:= SDL_GetMouseState(nil, nil);
 {$IFNDEF IPHONEOS}pkbd:={$ENDIF}SDL_GetKeyState(@j);
 
-TryDo(j < cKeyMaxIndex, 'SDL keys number is more than expected (' + inttostr(j) + ')', true);
+TryDo(j < cKeyMaxIndex, 'SDL keys number is more than expected (' + IntToStr(j) + ')', true);
 
 {$IFNDEF IPHONEOS}
 for i:= 1 to pred(j) do
@@ -262,7 +262,7 @@
 for i:= 6 to cKeyMaxIndex do
     begin
     s:= shortstring(sdl_getkeyname(i));
-    //writeln(stdout,inttostr(i) + ': ' + s);
+    //writeln(stdout,IntToStr(i) + ': ' + s);
     if s = 'unknown key' then KeyNames[i]:= ''
     else 
         begin
@@ -272,7 +272,7 @@
         end;
     end;
 
-//for i:= 0 to cKeyMaxIndex do writeln(stdout,inttostr(i) + ': ' + KeyNames[i]);
+//for i:= 0 to cKeyMaxIndex do writeln(stdout,IntToStr(i) + ': ' + KeyNames[i]);
 
 // get the size of keyboard array
 SDL_GetKeyState(@k);
@@ -282,21 +282,21 @@
     begin
     for i:= 0 to Pred(ControllerNumAxes[j]) do
         begin
-        keynames[k + 0]:= 'j' + inttostr(j) + 'a' + inttostr(i) + 'u';
-        keynames[k + 1]:= 'j' + inttostr(j) + 'a' + inttostr(i) + 'd';
+        keynames[k + 0]:= 'j' + IntToStr(j) + 'a' + IntToStr(i) + 'u';
+        keynames[k + 1]:= 'j' + IntToStr(j) + 'a' + IntToStr(i) + 'd';
         inc(k, 2);
         end;
     for i:= 0 to Pred(ControllerNumHats[j]) do
         begin
-        keynames[k + 0]:= 'j' + inttostr(j) + 'h' + inttostr(i) + 'u';
-        keynames[k + 1]:= 'j' + inttostr(j) + 'h' + inttostr(i) + 'r';
-        keynames[k + 2]:= 'j' + inttostr(j) + 'h' + inttostr(i) + 'd';
-        keynames[k + 3]:= 'j' + inttostr(j) + 'h' + inttostr(i) + 'l';
+        keynames[k + 0]:= 'j' + IntToStr(j) + 'h' + IntToStr(i) + 'u';
+        keynames[k + 1]:= 'j' + IntToStr(j) + 'h' + IntToStr(i) + 'r';
+        keynames[k + 2]:= 'j' + IntToStr(j) + 'h' + IntToStr(i) + 'd';
+        keynames[k + 3]:= 'j' + IntToStr(j) + 'h' + IntToStr(i) + 'l';
         inc(k, 4);
         end;
     for i:= 0 to Pred(ControllerNumButtons[j]) do
         begin
-        keynames[k]:= 'j' + inttostr(j) + 'b' + inttostr(i);
+        keynames[k]:= 'j' + IntToStr(j) + 'b' + IntToStr(i);
         inc(k, 1);
         end;
     end;
@@ -347,7 +347,7 @@
 DefaultBinds[KeyNameToCode('left_shift')]:= '+precise';
 {$ENDIF}
 
-for i:= 1 to 10 do DefaultBinds[KeyNameToCode('f'+inttostr(i))]:= 'slot '+inttostr(i);
+for i:= 1 to 10 do DefaultBinds[KeyNameToCode('f'+IntToStr(i))]:= 'slot '+IntToStr(i);
 
 SetDefaultBinds();
 end;
@@ -422,7 +422,7 @@
 ControllerNumControllers:= SDL_NumJoysticks();
 if ControllerNumControllers > 6 then ControllerNumControllers:= 6;
 
-WriteLnToConsole('Number of game controllers: ' + inttostr(ControllerNumControllers));
+WriteLnToConsole('Number of game controllers: ' + IntToStr(ControllerNumControllers));
 
 if ControllerNumControllers > 0 then
     begin
@@ -438,10 +438,10 @@
             //ControllerNumBalls[j]:= SDL_JoystickNumBalls(Controller[j]);
             ControllerNumHats[j]:= SDL_JoystickNumHats(Controller[j]);
             ControllerNumButtons[j]:= SDL_JoystickNumButtons(Controller[j]);
-            WriteLnToConsole('* Number of axes: ' + inttostr(ControllerNumAxes[j]));
-            //WriteLnToConsole('* Number of balls: ' + inttostr(ControllerNumBalls[j]));
-            WriteLnToConsole('* Number of hats: ' + inttostr(ControllerNumHats[j]));
-            WriteLnToConsole('* Number of buttons: ' + inttostr(ControllerNumButtons[j]));
+            WriteLnToConsole('* Number of axes: ' + IntToStr(ControllerNumAxes[j]));
+            //WriteLnToConsole('* Number of balls: ' + IntToStr(ControllerNumBalls[j]));
+            WriteLnToConsole('* Number of hats: ' + IntToStr(ControllerNumHats[j]));
+            WriteLnToConsole('* Number of buttons: ' + IntToStr(ControllerNumButtons[j]));
             ControllerEnabled:= 1;
 
             if ControllerNumAxes[j] > 20 then ControllerNumAxes[j]:= 20;