fix: preserve resolved Windows key button

This commit is contained in:
barrelltitor 2026-08-08 21:28:26 +03:00 committed by Nick Bolton
parent 5094580606
commit 079dee7682

View file

@ -1119,7 +1119,13 @@ bool MSWindowsScreen::onKey(WPARAM wParam, LPARAM lParam)
// process key // process key
KeyModifierMask mask; KeyModifierMask mask;
KeyID key = m_keyState->mapKeyFromEvent(wParam, lParam, &mask); KeyID key = m_keyState->mapKeyFromEvent(wParam, lParam, &mask);
button = static_cast<KeyButton>((lParam & 0x01ff0000u) >> 16); const KeyButton mappedButton = static_cast<KeyButton>((lParam & 0x01ff0000u) >> 16);
if (mappedButton != 0) {
// Ctrl+Alt+Del emulation deliberately substitutes its button in lParam.
// Otherwise retain the virtual-key fallback above for malformed input
// that has no scan code, so its key-up matches the key-down on clients.
button = mappedButton;
}
if (key != kKeyNone) { if (key != kKeyNone) {
// do it // do it
m_keyState->sendKeyEvent( m_keyState->sendKeyEvent(