diff options
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/chat.c | 28 |
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; |