1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-09 23:34:20 +00:00

changed the way keycodes are returned so that modifier keys are correctly removed from the keycode. This might mess up a few people's key-shortcut settings, but is now done the correct way.

This commit is contained in:
jules 2007-06-13 15:27:48 +00:00
parent d11e104152
commit 1ab50e37e6

View file

@ -1626,10 +1626,11 @@ private:
}
const juce_wchar textChar = (juce_wchar) key;
const int virtualScanCode = (flags >> 16) & 0xff;
if (key >= '0' && key <= '9')
{
switch ((flags >> 16) & 0xff) // check for a numeric keypad scan-code
switch (virtualScanCode) // check for a numeric keypad scan-code
{
case 0x52:
case 0x4f:
@ -1647,6 +1648,17 @@ private:
break;
}
}
else
{
// convert the scan code to an unmodified character code..
UINT keyChar = wMapVirtualKeyW != 0 ? wMapVirtualKeyW (wMapVirtualKeyW (virtualScanCode, 1), 2)
: MapVirtualKey (MapVirtualKey (virtualScanCode, 1), 2);
keyChar = LOWORD (keyChar);
if (keyChar != 0)
key = (int) keyChar;
}
handleKeyPress (key, textChar);
}