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

This commit is contained in:
zicodxx 2008-11-01 02:49:29 +00:00
parent 4b0041d815
commit b2213b6f2e
2 changed files with 5 additions and 5 deletions

View file

@ -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
--------

View file

@ -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]);