summaryrefslogtreecommitdiff
path: root/src/client/chat.c
diff options
context:
space:
mode:
authorTomas 'ZeXx86' Jedrzejek <zexx86@gmail.com>2009-04-19 11:09:58 +0200
committerTomas 'ZeXx86' Jedrzejek <zexx86@gmail.com>2009-04-19 11:09:58 +0200
commit82c397bde642ecacce33911c4d97b3cf664209c7 (patch)
tree2955e7c2bb2e8d4f6046b03306c0b1b3676718ff /src/client/chat.c
parent398dbc13478c62a747cf768a394592109b58a61f (diff)
Alternative ASCII character support in game chat
Small cleanup in browser.c file Address filter for widget textfield was updated
Diffstat (limited to 'src/client/chat.c')
-rw-r--r--src/client/chat.c28
1 files changed, 24 insertions, 4 deletions
diff --git a/src/client/chat.c b/src/client/chat.c
index 019445f..b6904c9 100644
--- a/src/client/chat.c
+++ b/src/client/chat.c
@@ -119,7 +119,21 @@ static void processMessageKey(SDL_keysym keysym)
{
int w, h;
int len;
- //int i;
+ unsigned n;
+
+ char shift_map[] = {
+ '-', '_',
+ '=', '+',
+ '[', '{',
+ ']', '}',
+ ';', ':',
+ '/', '\"',
+ '\\', '|',
+ ',', '<',
+ '.', '>',
+ '/', '?',
+ ')', '(',
+ };
if (line_atime < 100)
line_atime++;
@@ -145,9 +159,15 @@ static void processMessageKey(SDL_keysym keysym)
*/
char c = keysym.sym;
- /* TODO: should correspond with ASCII table */
- if (keysym.mod & KMOD_RSHIFT)
- c --;
+ if (keysym.mod & KMOD_RSHIFT) {
+ for (n = 0; n < sizeof (shift_map); n += 2) {
+ if (c == shift_map[n]) {
+ c = shift_map[n+1];
+ break;
+ }
+ }
+ }
+
line[len] = c;
return;