hedgewars/uKeys.pas
changeset 846 08c3f0bc766c
parent 626 a30171dbcd19
child 883 07a568ba44e0
equal deleted inserted replaced
845:ca72cf446ec2 846:08c3f0bc766c
    57      Trusted: boolean;
    57      Trusted: boolean;
    58 begin
    58 begin
    59 KbdKeyPressed:= false;
    59 KbdKeyPressed:= false;
    60 Trusted:= (CurrentTeam <> nil)
    60 Trusted:= (CurrentTeam <> nil)
    61           and (not CurrentTeam^.ExtDriven)
    61           and (not CurrentTeam^.ExtDriven)
    62           and (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].BotLevel = 0);
    62           and (CurrentHedgehog^.BotLevel = 0);
    63 
    63 
    64 pkbd:= SDL_GetKeyState(nil);
    64 pkbd:= SDL_GetKeyState(nil);
    65 i:= SDL_GetMouseState(nil, nil);
    65 i:= SDL_GetMouseState(nil, nil);
    66 pkbd^[1]:= (i and 1);
    66 pkbd^[1]:= (i and 1);
    67 pkbd^[2]:= ((i shr 1) and 1);
    67 pkbd^[2]:= ((i shr 1) and 1);
    75           if (pkbd^[i] <> 0)and(tkbd[i]  = 0) then ParseCommand(CurrentBinds[i], Trusted) else
    75           if (pkbd^[i] <> 0)and(tkbd[i]  = 0) then ParseCommand(CurrentBinds[i], Trusted) else
    76           if (pkbd^[i] =  0)and(tkbd[i] <> 0) then
    76           if (pkbd^[i] =  0)and(tkbd[i] <> 0) then
    77              begin
    77              begin
    78              s:= CurrentBinds[i];
    78              s:= CurrentBinds[i];
    79              s[1]:= '-';
    79              s[1]:= '-';
    80              ParseCommand(s, true)
    80              ParseCommand(s, Trusted)
    81              end;
    81              end;
    82           end else
    82           end else
    83           if (tkbd[i] = 0) and (pkbd^[i] <> 0) then ParseCommand(CurrentBinds[i], Trusted);
    83           if (tkbd[i] = 0) and (pkbd^[i] <> 0) then ParseCommand(CurrentBinds[i], Trusted);
    84        tkbd[i]:= pkbd^[i]
    84        tkbd[i]:= pkbd^[i]
    85        end
    85        end