From b2213b6f2e3f724fecb0a3d86021a13fac0e12bd Mon Sep 17 00:00:00 2001 From: zicodxx <> Date: Sat, 1 Nov 2008 02:49:29 +0000 Subject: [PATCH] Make sure that if we use UNICODE, we always take non-control type chars and - as we only want lowercase letters - convert chars if shift is pressed --- CHANGELOG.txt | 1 + arch/sdl/key.c | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index cb357ae99..2d6233516 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -3,6 +3,7 @@ D1X-Rebirth Changelog 20081101 -------- main/config.c, main/menu.c, main/newmenu.c, main/piggy.c: Fixed possible overflows in Jukebox Path; Menu GUI improvements: Correct inputbox scaling for font widths, a little performance boost when determinating string-part to show in inputbox, make it possible to flip over from first/last menu entry to last/first even if it's a ScrollBox, Scrolling via Maousebutton now works with delay; Made reading for Piggy data always break up in loops when reached end of file instead of provoking possible error if *data-count < max-data-count* +arch/sdl/key.c: Make sure that if we use UNICODE, we always take non-control type chars and - as we only want lowercase letters - convert chars if shift is pressed 20081031 -------- diff --git a/arch/sdl/key.c b/arch/sdl/key.c index 2bfecbe4e..275f053fe 100644 --- a/arch/sdl/key.c +++ b/arch/sdl/key.c @@ -21,7 +21,6 @@ #include "timer.h" #define KEY_BUFFER_SIZE 16 -#define UNICODE static unsigned char Installed = 0; @@ -359,10 +358,10 @@ void key_handler(SDL_KeyboardEvent *event) // Read SDLK symbol and state event_keysym = event->keysym.sym; - // Read unicode - if (event->keysym.unicode > 0) + // Read (latin) unicode + if (event->keysym.unicode > 31) { - event_keyuni = event->keysym.unicode; + event_keyuni = tolower(event->keysym.unicode); // Now add the UNICODE char to our map (see comment on sym2unimap declaration) for (i = 0; i < KEY_BUFFER_SIZE; i++) { @@ -387,10 +386,10 @@ void key_handler(SDL_KeyboardEvent *event) } key_state = (event->state == SDL_PRESSED); + //===================================================== for (i = 255; i >= 0; i--) { - keycode = i; key = &(key_data.keys[keycode]);