hedgewars/uChat.pas
changeset 12846 e5c461729fe3
parent 12410 8b971d8944d6
child 13077 c213645ff848
equal deleted inserted replaced
12845:b63ec501490b 12846:e5c461729fe3
  1096                 inc(visibleCount);
  1096                 inc(visibleCount);
  1097             end;
  1097             end;
  1098 end;
  1098 end;
  1099 
  1099 
  1100 procedure chChat(var s: shortstring);
  1100 procedure chChat(var s: shortstring);
       
  1101 var i: Integer;
  1101 begin
  1102 begin
  1102     s:= s; // avoid compiler hint
  1103     s:= s; // avoid compiler hint
  1103     GameState:= gsChat;
  1104     GameState:= gsChat;
  1104     SDL_StopTextInput();
  1105     SDL_StopTextInput();
  1105     SDL_StartTextInput();
  1106     SDL_StartTextInput();
       
  1107     //Make REALLY sure unexpected events are flushed (1 time is insufficient as of SDL 2.0.7)
       
  1108     for i := 1 to 2 do
       
  1109     begin
       
  1110         SDL_PumpEvents();
       
  1111         SDL_FlushEvent(SDL_TEXTINPUT);
       
  1112     end;
  1106     //SDL_EnableKeyRepeat(200,45);
  1113     //SDL_EnableKeyRepeat(200,45);
  1107     if length(s) = 0 then
  1114     if length(s) = 0 then
  1108         SetLine(InputStr, '', true)
  1115         SetLine(InputStr, '', true)
  1109     else
  1116     else
  1110         begin
  1117         begin