Open o-sdn-o opened 6 days ago
Since the operating system (at least 10.0.19045.5011) does not generate a right Shift key release WM_KEYUP
event after detecting a second Shift key pressed, the possible solution is to use a timer to track the right Shift key down state in the thread's keyboard buffer. This works reliably with a 33ms tick timer.
Thanks for filing! Does this repro in conhost /?
Does this repro in conhost /?
Yes, this issue is also reproduced in conhost.
#include <iostream>
#include <windows.h>
int main()
{
DWORD count;
INPUT_RECORD r;
HANDLE input = ::GetStdHandle(STD_INPUT_HANDLE);
while (true)
{
::ReadConsoleInputW(input, &r, 1, &count);
if (r.EventType == KEY_EVENT)
{
std::cout << "type: KEY_EVENT" << std::hex
<< ", down: " << r.Event.KeyEvent.bKeyDown
<< ", ctrl: " << r.Event.KeyEvent.dwControlKeyState
<< ", count: " << r.Event.KeyEvent.wRepeatCount
<< ", vcod: " << r.Event.KeyEvent.wVirtualKeyCode
<< ", scod: " << r.Event.KeyEvent.wVirtualScanCode
<< ", wchr: " << (int)r.Event.KeyEvent.uChar.UnicodeChar << '\n';
}
}
}
Windows Terminal version
current main
Windows build number
10.0.19045.5011
Other Software
No response
Steps to reproduce
Expected Behavior
There are four reports in the "debug tap" pane:
Actual Behavior
There are only three reports in the "debug tap" pane: