Properly press AltGr key in Windows Auto-Type

* Fix #7456
This commit is contained in:
Jonathan White 2022-02-24 06:50:47 -05:00
parent f3b0fe46b4
commit e85425050b
2 changed files with 26 additions and 16 deletions

View File

@ -102,6 +102,9 @@ void AutoTypePlatformWin::sendChar(const QChar& ch, bool isKeyDown)
return;
}
if (HIBYTE(vkey) & 0x6) {
sendKey(Qt::Key_AltGr, true);
} else {
if (HIBYTE(vkey) & 0x1) {
sendKey(Qt::Key_Shift, true);
}
@ -111,6 +114,7 @@ void AutoTypePlatformWin::sendChar(const QChar& ch, bool isKeyDown)
if (HIBYTE(vkey) & 0x4) {
sendKey(Qt::Key_Alt, true);
}
}
DWORD flags = KEYEVENTF_SCANCODE;
if (!isKeyDown) {
@ -127,6 +131,9 @@ void AutoTypePlatformWin::sendChar(const QChar& ch, bool isKeyDown)
::SendInput(1, &in, sizeof(INPUT));
if (HIBYTE(vkey) & 0x6) {
sendKey(Qt::Key_AltGr, false);
} else {
if (HIBYTE(vkey) & 0x1) {
sendKey(Qt::Key_Shift, false);
}
@ -136,6 +143,7 @@ void AutoTypePlatformWin::sendChar(const QChar& ch, bool isKeyDown)
if (HIBYTE(vkey) & 0x4) {
sendKey(Qt::Key_Alt, false);
}
}
}
//

View File

@ -267,6 +267,8 @@ WORD WinUtils::qtToNativeKeyCode(Qt::Key key)
return VK_HELP; // 0x2F
case Qt::Key_Meta:
return VK_LWIN; // 0x5B
case Qt::Key_AltGr:
return VK_RMENU; // 0xA5
case Qt::Key_F1:
return VK_F1; // 0x70