ingore moar keys
authorkoda
Sun, 17 Mar 2013 18:42:28 +0100
changeset 8745 b3756c3f65e5
parent 8744 6c87486fd89b
child 8746 55539c550c33
ingore moar keys
hedgewars/SDLh.pas
hedgewars/uChat.pas
--- a/hedgewars/SDLh.pas	Sun Mar 17 14:09:54 2013 -0400
+++ b/hedgewars/SDLh.pas	Sun Mar 17 18:42:28 2013 +0100
@@ -316,8 +316,15 @@
     SDLK_BACKSPACE = 8;
     SDLK_RETURN    = 13;
     SDLK_ESCAPE    = 27;
+    SDLK_DELETE    = 127;
     SDLK_UP        = 273;
     SDLK_DOWN      = 274;
+    SDLK_RIGHT     = 275;
+    SDLK_LEFT      = 276;
+    SDLK_HOME      = 278;
+    SDLK_END       = 279;
+    SDLK_PAGEUP    = 280;
+    SDLK_PAGEDOWN  = 281;
 
 
 /////////////////////////////////////////////////////////////////
--- a/hedgewars/uChat.pas	Sun Mar 17 14:09:54 2013 -0400
+++ b/hedgewars/uChat.pas	Sun Mar 17 18:42:28 2013 +0100
@@ -195,7 +195,7 @@
         i:= MaxStrIndex
     else
         dec(i);
-        
+
     inc(cnt);
     inc(t)
     end;
@@ -219,13 +219,13 @@
 x:= 0;
 if (s[1] = '"') and (s[Length(s)] = '"')
     then x:= 1
-    
+
 else if (s[1] = '''') and (s[Length(s)] = '''') then
     x:= 2
-    
+
 else if (s[1] = '-') and (s[Length(s)] = '-') then
     x:= 3;
-    
+
 if not CurrentTeam^.ExtDriven and (x <> 0) then
     for c:= 0 to Pred(TeamsCount) do
         if (TeamsArray[c] = CurrentTeam) then
@@ -283,7 +283,7 @@
             exit
             end;
 
-	for j:= Low(TChatCmd) to High(TChatCmd) do
+    for j:= Low(TChatCmd) to High(TChatCmd) do
         if (s = ChatCommandz[j].ChatCmd) then
             begin
             ParseCommand(ChatCommandz[j].ProcedureCallChatCmd, true);
@@ -309,27 +309,24 @@
     utf8: shortstring;
     action: boolean;
 begin
-    action:= false;
+    action:= true;
     case Sym of
         SDLK_BACKSPACE:
             begin
-            action:= true;
             if Length(InputStr.s) > 0 then
                 begin
                 InputStr.s[0]:= InputStrL[byte(InputStr.s[0])];
                 SetLine(InputStr, InputStr.s, true)
                 end
             end;
-        SDLK_ESCAPE: 
+        SDLK_ESCAPE:
             begin
-            action:= true;
-            if Length(InputStr.s) > 0 then 
+            if Length(InputStr.s) > 0 then
                 SetLine(InputStr, '', true)
             else CleanupInput
             end;
         SDLK_RETURN:
             begin
-            action:= true;
             if Length(InputStr.s) > 0 then
                 begin
                 AcceptChatString(InputStr.s);
@@ -339,14 +336,21 @@
             end;
         SDLK_UP, SDLK_DOWN:
             begin
-            action:= true;
             if (Sym = SDLK_UP) and (history < localLastStr) then inc(history);
             if (Sym = SDLK_DOWN) and (history > 0) then dec(history);
             index:= localLastStr - history + 1;
             if (index > localLastStr) then
                  SetLine(InputStr, '', true)
             else SetLine(InputStr, LocalStrs[index], true)
-            end
+            end;
+        SDLK_RIGHT, SDLK_LEFT, SDLK_DELETE,
+        SDLK_HOME, SDLK_END,
+        SDLK_PAGEUP, SDLK_PAGEDOWN:
+            begin
+            // ignore me!!!
+            end;
+        else
+            action:= false;
         end;
     if not action and (Key <> 0) then
         begin