mirror of
https://github.com/glfw/glfw.git
synced 2026-09-17 14:22:50 +00:00
Win32: Fix scancode for media keys
Media key events were incorrectly reported with a scancode of 0x100. This is based on a snippet by dougbinks in #2625. Fixes #1768 Closes #2417 Fixes #2625
This commit is contained in:
@@ -127,6 +127,7 @@ information on what to include when reporting a bug.
|
||||
- Updated minimum CMake version to 3.16 (#2541)
|
||||
- Removed support for building with original MinGW (#2540)
|
||||
- [Win32] Removed support for Windows XP and Vista (#2505)
|
||||
- [Win32] Bugfix: Media keys were reported with a scancode of 256 (#1768,#2417,#2625)
|
||||
- [Cocoa] Added `QuartzCore` framework as link-time dependency
|
||||
- [Cocoa] Removed support for OS X 10.10 Yosemite and earlier (#2506)
|
||||
- [Cocoa] Bugfix: Cmd+Period, Ctrl+Tab and Ctrl+Esc key events were not emitted
|
||||
|
||||
+5
-4
@@ -711,11 +711,12 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM l
|
||||
const int mods = getKeyMods();
|
||||
|
||||
scancode = (HIWORD(lParam) & (KF_EXTENDED | 0xff));
|
||||
if (!scancode)
|
||||
if (!(scancode & 0xff))
|
||||
{
|
||||
// NOTE: Some synthetic key messages have a scancode of zero
|
||||
// HACK: Map the virtual key back to a usable scancode
|
||||
scancode = MapVirtualKeyW((UINT) wParam, MAPVK_VK_TO_VSC);
|
||||
// NOTE: Both media keys and the synthetic key messages from Windows
|
||||
// Clipboard History are reported with a scancode of zero
|
||||
// HACK: Map the virtual key to a scancode but preserve extended bit
|
||||
scancode |= MapVirtualKeyW((UINT) wParam, MAPVK_VK_TO_VSC);
|
||||
}
|
||||
|
||||
// HACK: Alt+PrtSc has a different scancode than just PrtSc
|
||||
|
||||
Reference in New Issue
Block a user