June 5, 2026
9:12 a.m.
On Fri Jun 5 06:45:06 2026 +0000, Rémi Bernon wrote:
Seem weird and unfortunate to have these special cases isolated out of the mapping helpers and duplicated around. Same for BREAK above. Why can't they be handled in the keyc2scan mapping? Because, as per the test results, you have e.g.:
MapVirtualKeyExA(0x45, MAPVK_VSC_TO_VK_EX, ...); -> VK_NUMLOCK
MapVirtualKeyExA(VK_NUMLOCK, MAPVK_VK_TO_VSC_EX, ...); -> 0x45
MapVirtualKeyExA(0xe11d, MAPVK_VSC_TO_VK_EX, ...); -> VK_PAUSE
MapVirtualKeyExA(VK_PAUSE, MAPVK_VK_TO_VSC_EX, ...); -> 0xe11d
GetKeyNameTextA(0x00450000, ...); -> "Pause"
GetKeyNameTextA(0x01450000, ...); -> "Num Lock"
GetKeyNameTextA(0xe11d0000, ...); -> "Right Ctrl"
i.e. the whole mapping is inconsistent for those particular keys and we don't want to break `MapVirtualKeyExA()`. FWIW, actually pressing the buttons on the keyboard matches with `GetKeyNameTextA()`; the kbdus.dll KBDTABLES on Windows does confirm the `MapVirtualKeyExA()` mapping as per above i.e. the special casing isn't in the `MapVirtualKeyExA()` machinery. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10963#note_142288