hedgewars/uChat.pas
changeset 5100 951767beffc8
parent 5099 ce1a761d3c1e
child 5392 1840da0c1f1d
--- a/hedgewars/uChat.pas	Mon Apr 04 12:53:11 2011 +0200
+++ b/hedgewars/uChat.pas	Mon Apr 04 16:27:27 2011 +0200
@@ -269,7 +269,13 @@
                 SetLine(InputStr, InputStr.s, true)
                 end;
         {Esc}
-        27: SetLine(InputStr, '', true);
+        27: if Length(InputStr.s) > 0 then SetLine(InputStr, '', true)
+            else
+                begin
+                FreezeEnterKey;
+                SDL_EnableKeyRepeat(0,0);
+                GameState:= gsGame;
+                end;
         {Return}
         3, 13, 271: begin
             if Length(InputStr.s) > 0 then
@@ -342,9 +348,10 @@
     GameState:= gsChat;
     SDL_EnableKeyRepeat(200,45);
     if length(s) = 0 then
-        KeyPressChat(27)
+        SetLine(InputStr, '', true)
     else
         begin
+        // err, does anyone have any documentation on this sequence?
         KeyPressChat(27);
         KeyPressChat(47);
         KeyPressChat(116);