(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

@@ -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);
}
}