Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
This trick only works for English
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Jun 18, 2006
1 parent bcd3c30 commit 8b92121
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/SDL_compat.c
Expand Up @@ -208,12 +208,13 @@ SDL_CompatEventFilter(SDL_Event * event)
{
Uint32 unicode = 0;
if (event->key.type == SDL_KEYDOWN && event->key.keysym.sym < 256) {
int shifted = !!(event->key.keysym.mod & KMOD_SHIFT);
int capslock = !!(event->key.keysym.mod & KMOD_CAPS);
if ((shifted ^ capslock) != 0) {
unicode = SDL_toupper(event->key.keysym.sym);
} else {
unicode = event->key.keysym.sym;
unicode = event->key.keysym.sym;
if(unicode >= 'a' && unicode <= 'z') {
int shifted = !!(event->key.keysym.mod & KMOD_SHIFT);
int capslock = !!(event->key.keysym.mod & KMOD_CAPS);
if ((shifted ^ capslock) != 0) {
unicode = SDL_toupper(unicode);
}
}
}
if (unicode) {
Expand Down

0 comments on commit 8b92121

Please sign in to comment.