Workaround of issue 167: Unicode only enabled while entering text, so at all other moments there's no SDL crash when pressing ^ key (French or German keyboard) on Windows 98

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@812 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Yves Rizoud
2009-05-22 18:14:13 +00:00
parent 4f157197e8
commit e8dd8588d0
3 changed files with 7 additions and 1 deletions

View File

@@ -543,6 +543,9 @@ word Keysym_to_ANSI(SDL_keysym keysym)
#if !(defined(__macosx__) || defined(__FreeBSD__))
if ( keysym.unicode == 0)
{
// Converty lowercase to uppercase if SHIFT is on.
if (keysym.sym >= 'a' && keysym.sym <= 'z' && (SDL_GetModState() & (KMOD_SHIFT|KMOD_CAPS)))
return ('A' - 'a') + keysym.sym;
return keysym.sym;
}
#endif