diff options
author | michi_cc <michi_cc@openttd.org> | 2013-08-05 20:36:36 +0000 |
---|---|---|
committer | michi_cc <michi_cc@openttd.org> | 2013-08-05 20:36:36 +0000 |
commit | 019984a14f01e4463ae479765d2340ff26055367 (patch) | |
tree | 291b47c56523ebef7368f3588e921a1cdb78f331 /src/video/allegro_v.cpp | |
parent | 270d8aa639341f8be7fde9aa6e6f5bb6fa894d4f (diff) | |
download | openttd-019984a14f01e4463ae479765d2340ff26055367.tar.xz |
(svn r25671) -Codechange: Pass character and key code separately to the keyboard handler.
Diffstat (limited to 'src/video/allegro_v.cpp')
-rw-r--r-- | src/video/allegro_v.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/video/allegro_v.cpp b/src/video/allegro_v.cpp index 029cc062a..963353f0d 100644 --- a/src/video/allegro_v.cpp +++ b/src/video/allegro_v.cpp @@ -304,7 +304,7 @@ static const VkMapping _vk_mapping[] = { AS(KEY_TILDE, WKC_BACKQUOTE), }; -static uint32 ConvertAllegroKeyIntoMy() +static uint32 ConvertAllegroKeyIntoMy(WChar *character) { int scancode; int unicode = ureadkey(&scancode); @@ -326,7 +326,9 @@ static uint32 ConvertAllegroKeyIntoMy() DEBUG(driver, 0, "Scancode character pressed %u", scancode); DEBUG(driver, 0, "Unicode character pressed %u", unicode); #endif - return (key << 16) + unicode; + + *character = unicode; + return key; } static const uint LEFT_BUTTON = 0; @@ -414,7 +416,9 @@ static void PollEvent() if ((key_shifts & KB_ALT_FLAG) && (key[KEY_ENTER] || key[KEY_F])) { ToggleFullScreen(!_fullscreen); } else if (keypressed()) { - HandleKeypress(ConvertAllegroKeyIntoMy()); + WChar character; + uint keycode = ConvertAllegroKeyIntoMy(&character); + HandleKeypress(keycode, character); } } |