1)
Prevent usage of AltGr key not to be classified as key with control modifier. Because of this some chars can't be entered to GUI components. For example, on Finnish keyboard '@' is entered by pressing AltGr+2 (or alternatively Ctrl-Alt-2). EditBox UI code ignores it as it sees control modifier being held down. A hack to workaround this is to add the following code before posting key event in WndProc:
Code: Select all
if ((allKeys[VK_MENU] & 0x80) != 0)
event.KeyInput.Control = 0;2)
Fix for dead keys. Dead key is a key where pressing it doesn't first do anything, and then pressing next key produces a combination of characters. For example, on European keyboards pressing '¨' and 'u' lead to typing of character 'ü'.
For this to work, I think the character translation code in WndProc needs to be changed from usage of ToAscii to usage of ToUnicode. Additionally the "TranslateMessage(&msg);" call needs to be removed, as it translates the keys to char events and alters behavior of ToUnicode, and those events aren't used.
The code to use ToUnicode instead of ToAscii looks like this:
Code: Select all
WCHAR keyChars[2];
UINT scanCode = HIWORD(lParam);
int conversionResult = ToUnicode((UINT)wParam,scanCode,allKeys,keyChars,
sizeof(keyChars)/sizeof(keyChars[0]),0);
if (conversionResult == 1)
event.KeyInput.Char = keyChars[0];
else
event.KeyInput.Char = 0;
// .. now just postEventFromUser -- or maybe first apply the hack mentioned in point 1) above.
3)
I noted that the Irrlicht SDL driver omits filling the modifier and Char fields of key events. That should be easily fixed by copying the data from the SDL event structures. Just remember to add call to SDL_EnableUNICODE(1); at the initialization phase and fill the irr event's Char field from the SDL keysym's unicode field.