summaryrefslogtreecommitdiff
path: root/src/video/sdl_v.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/video/sdl_v.cpp')
-rw-r--r--src/video/sdl_v.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/video/sdl_v.cpp b/src/video/sdl_v.cpp
index d66ad59a8..a95e86332 100644
--- a/src/video/sdl_v.cpp
+++ b/src/video/sdl_v.cpp
@@ -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;