(svn r25671) -Codechange: Pass character and key code separately to the keyboard handler.

This commit is contained in:
michi_cc
2013-08-05 20:36:36 +00:00
parent 270d8aa639
commit 019984a14f
6 changed files with 25 additions and 20 deletions

View File

@@ -495,7 +495,7 @@ static const VkMapping _vk_mapping[] = {
AS(SDLK_PERIOD, WKC_PERIOD)
};
static uint32 ConvertSdlKeyIntoMy(SDL_keysym *sym)
static uint ConvertSdlKeyIntoMy(SDL_keysym *sym, WChar *character)
{
const VkMapping *map;
uint key = 0;
@@ -531,7 +531,8 @@ static uint32 ConvertSdlKeyIntoMy(SDL_keysym *sym)
if (sym->mod & KMOD_CTRL) key |= WKC_CTRL;
if (sym->mod & KMOD_ALT) key |= WKC_ALT;
return (key << 16) + sym->unicode;
*character = sym->unicode;
return key;
}
int VideoDriver_SDL::PollEvent()
@@ -617,7 +618,9 @@ int VideoDriver_SDL::PollEvent()
(ev.key.keysym.sym == SDLK_RETURN || ev.key.keysym.sym == SDLK_f)) {
ToggleFullScreen(!_fullscreen);
} else {
HandleKeypress(ConvertSdlKeyIntoMy(&ev.key.keysym));
WChar character;
uint keycode = ConvertSdlKeyIntoMy(&ev.key.keysym, &character);
HandleKeypress(keycode, character);
}
break;