hedgewars/uKeys.pas
changeset 3221 3e6586c1ab4f
parent 3038 4e48c276a468
child 3347 5d0ac8197eb7
--- a/hedgewars/uKeys.pas	Wed Mar 31 22:02:12 2010 +0000
+++ b/hedgewars/uKeys.pas	Wed Mar 31 22:54:28 2010 +0000
@@ -102,8 +102,8 @@
 procedure ProcessKbd;
 var  i, j, k: LongInt;
      s: shortstring;
-     pkbd: PByteArray;
      Trusted: boolean;
+{$IFNDEF IPHONEOS}pkbd: PByteArray;{$ENDIF}
 begin
 hideAmmoMenu:= false;
 Trusted:= (CurrentTeam <> nil)
@@ -115,9 +115,11 @@
 movecursor(5 * CursorMovementX, 5 * CursorMovementY);
 
 k:= SDL_GetMouseState(nil, nil);
+
+{$IFDEF IPHONEOS}
+SDL_GetKeyState(@j);
+{$ELSE}
 pkbd:= SDL_GetKeyState(@j);
-
-{$IFNDEF IPHONEOS}
 for i:= 6 to pred(j) do // first 6 will be overwritten
     tkbdn[i]:= pkbd^[i];
 {$ENDIF}
@@ -187,11 +189,11 @@
 
 procedure ResetKbd;
 var i, j, k, t: LongInt;
-    pkbd: PByteArray;
+{$IFNDEF IPHONEOS}pkbd: PByteArray;{$ENDIF}
 begin
 
 k:= SDL_GetMouseState(nil, nil);
-pkbd:= SDL_GetKeyState(@j);
+{$IFNDEF IPHONEOS}pkbd:={$ENDIF}SDL_GetKeyState(@j);
 
 TryDo(j < cKeyMaxIndex, 'SDL keys number is more than expected (' + inttostr(j) + ')', true);