shithub: choc

Download patch

ref: cfd1a3f8f739b049af04b9e637db9a51758cef27
parent: 4a356b565d08ee48dbe8d920876fd73a72dbc016
author: Simon Howard <[email protected]>
date: Sat Oct 22 13:23:25 EDT 2011

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

--- 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
--- 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 @@
         }
         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 @@
                 }
                 CT_ClearChatMessage(i);
             }
-            else if (c == CT_BACKSPACE)
+            else if (c == KEY_BACKSPACE)
             {
                 CT_BackSpace(i);
             }
--- a/src/hexen/ct_chat.c
+++ b/src/hexen/ct_chat.c
@@ -52,12 +52,6 @@
     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 @@
         }
         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 @@
                 }
                 CT_ClearChatMessage(i);
             }
-            else if (c == CT_BACKSPACE)
+            else if (c == KEY_BACKSPACE)
             {
                 CT_BackSpace(i);
             }