Browse Source

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.

tags/2021-05-28
jules 18 years ago
parent
commit
1ab50e37e6
1 changed files with 13 additions and 1 deletions
  1. +13
    -1
      build/win32/platform_specific_code/juce_win32_Windowing.cpp

+ 13
- 1
build/win32/platform_specific_code/juce_win32_Windowing.cpp 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);
}


Loading…
Cancel
Save