hedgewars/hwengine.dpr
changeset 946 42c5cc87cbd1
parent 942 b41af014d85e
child 947 4e0c3ad89483
equal deleted inserted replaced
945:4ead9cde4e14 946:42c5cc87cbd1
   147 begin
   147 begin
   148 PrevTime:= SDL_GetTicks;
   148 PrevTime:= SDL_GetTicks;
   149 repeat
   149 repeat
   150 while SDL_PollEvent(@event) <> 0 do
   150 while SDL_PollEvent(@event) <> 0 do
   151       case event.type_ of
   151       case event.type_ of
   152            SDL_KEYDOWN: case GameState of
   152            SDL_KEYDOWN: if GameState = gsChat then KeyPressChat(event.key.keysym.unicode);
   153                              gsGame: if event.key.keysym.sym = 96 then
       
   154                                         begin
       
   155                                         cConsoleYAdd:= cConsoleHeight;
       
   156                                         GameState:= gsConsole
       
   157                                         end;
       
   158                           gsConsole: if event.key.keysym.sym = 96 then
       
   159                                         begin
       
   160                                         GameState:= gsGame;
       
   161                                         cConsoleYAdd:= 0;
       
   162                                         ResetKbd
       
   163                                         end else KeyPressConsole(event.key.keysym.unicode);
       
   164                              end;
       
   165            SDL_ACTIVEEVENT: if (event.active.state and SDL_APPINPUTFOCUS) <> 0 then
   153            SDL_ACTIVEEVENT: if (event.active.state and SDL_APPINPUTFOCUS) <> 0 then
   166                                cHasFocus:= event.active.gain = 1;
   154                                cHasFocus:= event.active.gain = 1;
   167            SDL_QUITEV: isTerminated:= true
   155            SDL_QUITEV: isTerminated:= true
   168            end;
   156            end;
   169 CurrTime:= SDL_GetTicks;
   157 CurrTime:= SDL_GetTicks;