hedgewars/uInputHandler.pas
branchwebgl
changeset 8018 091293bc974f
parent 7974 7ac6699b6228
child 8145 6408c0ba4ba1
equal deleted inserted replaced
8008:2ed42786aca7 8018:091293bc974f
   119     s      : string;
   119     s      : string;
   120 begin
   120 begin
   121 if not(tkbd[code] xor KeyDown) then exit;
   121 if not(tkbd[code] xor KeyDown) then exit;
   122 tkbd[code]:= KeyDown;
   122 tkbd[code]:= KeyDown;
   123 
   123 
   124 hideAmmoMenu:= false;
       
   125 Trusted:= (CurrentTeam <> nil)
   124 Trusted:= (CurrentTeam <> nil)
   126           and (not CurrentTeam^.ExtDriven)
   125           and (not CurrentTeam^.ExtDriven)
   127           and (CurrentHedgehog^.BotLevel = 0);
   126           and (CurrentHedgehog^.BotLevel = 0);
   128 
   127 
   129 // ctrl/cmd + q to close engine and frontend
   128 // ctrl/cmd + q to close engine and frontend
   153         ParseCommand('forcequit', true);
   152         ParseCommand('forcequit', true);
   154     end;
   153     end;
   155 
   154 
   156 if CurrentBinds[code][0] <> #0 then
   155 if CurrentBinds[code][0] <> #0 then
   157     begin
   156     begin
   158     if (code > 3) and KeyDown and (not ((CurrentBinds[code] = 'put')) or (CurrentBinds[code] = 'ammomenu') or (CurrentBinds[code] = '+cur_u') or (CurrentBinds[code] = '+cur_d') or (CurrentBinds[code] = '+cur_l') or (CurrentBinds[code] = '+cur_r')) then hideAmmoMenu:= true;
   157     if (code > 3) and KeyDown and (not ((CurrentBinds[code] = 'put')) or (CurrentBinds[code] = 'ammomenu') or (CurrentBinds[code] = '+cur_u') or (CurrentBinds[code] = '+cur_d') or (CurrentBinds[code] = '+cur_l') or (CurrentBinds[code] = '+cur_r')) and (CurrentTeam <> nil) and (not CurrentTeam^.ExtDriven) then bShowAmmoMenu:= false;
   159 
   158 
   160     if KeyDown then
   159     if KeyDown then
   161         begin
   160         begin
   162         ParseCommand(CurrentBinds[code], Trusted);
   161         ParseCommand(CurrentBinds[code], Trusted);
   163         if (CurrentTeam <> nil) and (not CurrentTeam^.ExtDriven) and (ReadyTimeLeft > 1) then
   162         if (CurrentTeam <> nil) and (not CurrentTeam^.ExtDriven) and (ReadyTimeLeft > 1) then
   279 DefaultBinds[KeyNameToCode(_S's')]:= '+speedup';
   278 DefaultBinds[KeyNameToCode(_S's')]:= '+speedup';
   280 DefaultBinds[KeyNameToCode(_S't')]:= 'chat';
   279 DefaultBinds[KeyNameToCode(_S't')]:= 'chat';
   281 DefaultBinds[KeyNameToCode(_S'y')]:= 'confirm';
   280 DefaultBinds[KeyNameToCode(_S'y')]:= 'confirm';
   282 
   281 
   283 DefaultBinds[KeyNameToCode('mousem')]:= 'zoomreset';
   282 DefaultBinds[KeyNameToCode('mousem')]:= 'zoomreset';
   284 DefaultBinds[KeyNameToCode('wheelup')]:= 'zoomin';
   283 DefaultBinds[KeyNameToCode('wheelup')]:= 'zoomout';
   285 DefaultBinds[KeyNameToCode('wheeldown')]:= 'zoomout';
   284 DefaultBinds[KeyNameToCode('wheeldown')]:= 'zoomin';
   286 
   285 
   287 DefaultBinds[KeyNameToCode('f12')]:= 'fullscr';
   286 DefaultBinds[KeyNameToCode('f12')]:= 'fullscr';
   288 
   287 
   289 
   288 
   290 DefaultBinds[KeyNameToCode('mousel')]:= '/put';
   289 DefaultBinds[KeyNameToCode('mousel')]:= '/put';