summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Howard2007-03-16 22:26:06 +0000
committerSimon Howard2007-03-16 22:26:06 +0000
commitcb0892800052958253795d8ac9399f71b4848a53 (patch)
treeebb5b332c8795c4ae59a42d7984c04c08bcbf34a /src
parent1658ae111ec89bc32d63dcb12848337a968a0400 (diff)
downloadchocolate-doom-cb0892800052958253795d8ac9399f71b4848a53.tar.gz
chocolate-doom-cb0892800052958253795d8ac9399f71b4848a53.tar.bz2
chocolate-doom-cb0892800052958253795d8ac9399f71b4848a53.zip
Add back shiftxform table so that the shift key works in multiplayer
chat when vanilla_keyboard_mapping is enabled. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 861
Diffstat (limited to 'src')
-rw-r--r--src/hu_stuff.c51
-rw-r--r--src/i_video.h1
-rw-r--r--src/m_misc.c1
3 files changed, 52 insertions, 1 deletions
diff --git a/src/hu_stuff.c b/src/hu_stuff.c
index 32ca1fc3..e6699438 100644
--- a/src/hu_stuff.c
+++ b/src/hu_stuff.c
@@ -32,6 +32,7 @@
#include "deh_main.h"
#include "i_swap.h"
+#include "i_video.h"
#include "hu_stuff.h"
#include "hu_lib.h"
@@ -284,6 +285,48 @@ char *mapnamest[] = // TNT WAD map names.
THUSTR_32
};
+static const char shiftxform[] =
+{
+
+ 0,
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
+ 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
+ 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
+ 31,
+ ' ', '!', '"', '#', '$', '%', '&',
+ '"', // shift-'
+ '(', ')', '*', '+',
+ '<', // shift-,
+ '_', // shift--
+ '>', // shift-.
+ '?', // shift-/
+ ')', // shift-0
+ '!', // shift-1
+ '@', // shift-2
+ '#', // shift-3
+ '$', // shift-4
+ '%', // shift-5
+ '^', // shift-6
+ '&', // shift-7
+ '*', // shift-8
+ '(', // shift-9
+ ':',
+ ':', // shift-;
+ '<',
+ '+', // shift-=
+ '>', '?', '@',
+ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
+ 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
+ '[', // shift-[
+ '!', // shift-backslash - OH MY GOD DOES WATCOM SUCK
+ ']', // shift-]
+ '"', '_',
+ '\'', // shift-`
+ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
+ 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
+ '{', '|', '}', '~', 127
+};
+
void HU_Init(void)
{
@@ -616,6 +659,14 @@ boolean HU_Responder(event_t *ev)
}
else
{
+ if (vanilla_keyboard_mapping)
+ {
+ if (shiftdown || (c >= 'a' && c <= 'z'))
+ {
+ c = shiftxform[c];
+ }
+ }
+
eatkey = HUlib_keyInIText(&w_chat, c);
if (eatkey)
{
diff --git a/src/i_video.h b/src/i_video.h
index a9d7faa1..2eeb8343 100644
--- a/src/i_video.h
+++ b/src/i_video.h
@@ -70,5 +70,6 @@ extern boolean grabmouse;
extern float mouse_acceleration;
extern int mouse_threshold;
extern int startup_delay;
+extern int vanilla_keyboard_mapping;
#endif
diff --git a/src/m_misc.c b/src/m_misc.c
index 84a2e3fa..6e0af575 100644
--- a/src/m_misc.c
+++ b/src/m_misc.c
@@ -280,7 +280,6 @@ extern char* chat_macros[];
extern int show_endoom;
extern int vanilla_savegame_limit;
extern int vanilla_demo_limit;
-extern int vanilla_keyboard_mapping;
extern int snd_musicdevice;
extern int snd_sfxdevice;