foxygit / doom Log in
commit cfd1a3f8f739b049af04b9e637db9a51758cef27
Author:     Simon Howard <fraggle@gmail.com>
AuthorDate: Sat Oct 22 17:23:25 2011 +0000
Commit:     Simon Howard <fraggle@gmail.com>
CommitDate: Sat Oct 22 17:23:25 2011 +0000

    Change KEY_BACKSPACE to 0x7f to fix problems with the backspace key not
    working in multiplayer chat. This matches the definition for the value
    from the Doom source release.

    Subversion-branch: /branches/v2-branch
    Subversion-revision: 2456
---
 src/doomkeys.h        |  2 +-
 src/heretic/ct_chat.c |  7 ++-----
 src/hexen/ct_chat.c   | 10 ++--------
 3 files changed, 5 insertions(+), 14 deletions(-)

diff --git a/src/doomkeys.h b/src/doomkeys.h
index 3db17a6d..4fd074e3 100644
--- a/src/doomkeys.h
+++ b/src/doomkeys.h
@@ -52,7 +52,7 @@
 #define KEY_F11		(0x80+0x57)
 #define KEY_F12		(0x80+0x58)

-#define KEY_BACKSPACE	'\b'
+#define KEY_BACKSPACE	0x7f
 #define KEY_PAUSE	0xff

 #define KEY_EQUALS	0x3d
diff --git a/src/heretic/ct_chat.c b/src/heretic/ct_chat.c
index 01e43383..4b89fe89 100644
--- a/src/heretic/ct_chat.c
+++ b/src/heretic/ct_chat.c
@@ -47,9 +47,6 @@
 #define CT_PLR_BLUE		4
 #define CT_PLR_ALL		5

-// Vanilla Heretic seems to use this for KEY_BACKSPACE (tcpdump'ed trace):
-#define CT_BACKSPACE 0x7f
-
 #define CT_ESCAPE 6

 // Public data
@@ -244,7 +241,7 @@ boolean CT_Responder(event_t * ev)
         }
         else if (ev->data1 == KEY_BACKSPACE)
         {
-            CT_queueChatChar(CT_BACKSPACE);
+            CT_queueChatChar(KEY_BACKSPACE);
             return true;
         }
         else if (ValidChatChar(ev->data2))
@@ -331,7 +328,7 @@ void CT_Ticker(void)
                 }
                 CT_ClearChatMessage(i);
             }
-            else if (c == CT_BACKSPACE)
+            else if (c == KEY_BACKSPACE)
             {
                 CT_BackSpace(i);
             }
diff --git a/src/hexen/ct_chat.c b/src/hexen/ct_chat.c
index 0d0dd49b..fab7582d 100644
--- a/src/hexen/ct_chat.c
+++ b/src/hexen/ct_chat.c
@@ -52,12 +52,6 @@ enum
     CT_PLR_ALL
 };

-// KEY_BACKSPACE (ASCII code 0x08) can't be used, because it conflicts with
-// CT_PLR_PLAYER8. Investigation reveals that Vanilla Hexen appears to use
-// this value for backspace.
-
-#define CT_BACKSPACE 0x7f
-
 #define CT_ESCAPE 6

 // Public data
@@ -285,7 +279,7 @@ boolean CT_Responder(event_t * ev)
         }
         else if (ev->data1 == KEY_BACKSPACE)
         {
-            CT_queueChatChar(CT_BACKSPACE);
+            CT_queueChatChar(KEY_BACKSPACE);
             return true;
         }
         else if (ValidChatChar(ev->data2))
@@ -364,7 +358,7 @@ void CT_Ticker(void)
                 }
                 CT_ClearChatMessage(i);
             }
-            else if (c == CT_BACKSPACE)
+            else if (c == KEY_BACKSPACE)
             {
                 CT_BackSpace(i);
             }