hedgewars/uChat.pas
changeset 7117 7df6386f7090
parent 6954 a61458a81480
child 7188 580cd247511e
child 7722 1518827049ed
equal deleted inserted replaced
7116:547b5be3a8e5 7117:7df6386f7090
   275 procedure KeyPressChat(Key: Longword);
   275 procedure KeyPressChat(Key: Longword);
   276 const firstByteMark: array[0..3] of byte = (0, $C0, $E0, $F0);
   276 const firstByteMark: array[0..3] of byte = (0, $C0, $E0, $F0);
   277 var i, btw: integer;
   277 var i, btw: integer;
   278     utf8: shortstring;
   278     utf8: shortstring;
   279 begin
   279 begin
   280 
       
   281 if Key <> 0 then
   280 if Key <> 0 then
   282     case Key of
   281     case Key of
   283         {Backspace}
   282         {Backspace}
   284         8, 127: if Length(InputStr.s) > 0 then
   283         8, 127: if Length(InputStr.s) > 0 then
   285                 begin
   284                 begin
   291             else
   290             else
   292                 begin
   291                 begin
   293                 FreezeEnterKey;
   292                 FreezeEnterKey;
   294                 SDL_EnableKeyRepeat(0,0);
   293                 SDL_EnableKeyRepeat(0,0);
   295                 GameState:= gsGame;
   294                 GameState:= gsGame;
       
   295                 ResetKbd;
   296                 end;
   296                 end;
   297         {Return}
   297         {Return}
   298         3, 13, 271: begin
   298         3, 13, 271: begin
   299             if Length(InputStr.s) > 0 then
   299             if Length(InputStr.s) > 0 then
   300                 begin
   300                 begin
   302                 SetLine(InputStr, '', false)
   302                 SetLine(InputStr, '', false)
   303                 end;
   303                 end;
   304             FreezeEnterKey;
   304             FreezeEnterKey;
   305             SDL_EnableKeyRepeat(0,0);
   305             SDL_EnableKeyRepeat(0,0);
   306             GameState:= gsGame;
   306             GameState:= gsGame;
       
   307             ResetKbd;
   307             end;
   308             end;
   308     else
   309     else
   309         if (Key < $80) then
   310         if (Key < $80) then
   310             btw:= 1
   311             btw:= 1
   311         else if (Key < $800) then
   312         else if (Key < $800) then