From ce19d33b99ba02fb29297a21bf88d830e708cb27 Mon Sep 17 00:00:00 2001 From: Tomas 'ZeXx86' Jedrzejek Date: Sat, 18 Apr 2009 21:38:03 +0200 Subject: In-Game Chat was improved - Upper-Letter support + Additional character set; Optimalization of widget_textfield's readKey () --- src/client/chat.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/client') diff --git a/src/client/chat.c b/src/client/chat.c index 9d35519..ca98389 100644 --- a/src/client/chat.c +++ b/src/client/chat.c @@ -143,13 +143,21 @@ static void processMessageKey(SDL_keysym keysym) /* here would be much better to put 'strcat' as 'line' is expected * to be full of '0' up to its end */ - line[len] = keysym.sym; + char c = keysym.sym; + + /* TODO: should correspond with ASCII table */ + if (keysym.mod & KMOD_RSHIFT) + c --; + + line[len] = c; + return; } /* processing of letters */ if (keysym.sym >= SDLK_a && keysym.sym <= SDLK_z) { char c = keysym.sym; - if (keysym.mod == KMOD_SHIFT) { + + if (keysym.mod & KMOD_SHIFT) { c = toupper(c); } /* here would be much better to put 'strcat' as 'line' is expected -- cgit v1.2.3