Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Releasing both pressed Shift keys (left+right) reports only one #18223

Open
o-sdn-o opened this issue Nov 20, 2024 · 3 comments
Open

Releasing both pressed Shift keys (left+right) reports only one #18223

o-sdn-o opened this issue Nov 20, 2024 · 3 comments
Labels
Area-Input Related to input processing (key presses, mouse, etc.) Help Wanted We encourage anyone to jump in on these. Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Attention The core contributors need to come back around and look at this ASAP. Priority-3 A description (P3) Product-Terminal The new Windows Terminal.
Milestone

Comments

@o-sdn-o
Copy link

o-sdn-o commented Nov 20, 2024

Windows Terminal version

current main

Windows build number

10.0.19045.5011

Other Software

No response

Steps to reproduce

  1. Activate "debug tap" pane.
    • Add the global setting (near the top of your JSON file):
      "debugFeatures": true
      
    • Open a new tab while holding down both left and right Alt .
  2. Press and release both Shift keys simultaneously.

Expected Behavior

There are four reports in the "debug tap" pane:

  • The first Shift key was pressed.
  • The second Shift key was pressed.
  • Some Shift key was released.
  • The remaining Shift key was released.

Actual Behavior

Image

There are only three reports in the "debug tap" pane:

  • The first Shift key was pressed.
  • The second Shift key was pressed.
  • Some Shift key was released.
@o-sdn-o o-sdn-o added Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Nov 20, 2024
@o-sdn-o
Copy link
Author

o-sdn-o commented Nov 20, 2024

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.

@carlos-zamora carlos-zamora added Area-Input Related to input processing (key presses, mouse, etc.) Product-Terminal The new Windows Terminal. Priority-3 A description (P3) and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Nov 20, 2024
@carlos-zamora carlos-zamora added this to the Backlog milestone Nov 20, 2024
@carlos-zamora carlos-zamora added the Help Wanted We encourage anyone to jump in on these. label Nov 20, 2024
@carlos-zamora
Copy link
Member

Thanks for filing! Does this repro in conhost /?

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Nov 20, 2024
@o-sdn-o
Copy link
Author

o-sdn-o commented Nov 21, 2024

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';
        }
    }
}

Image

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Input Related to input processing (key presses, mouse, etc.) Help Wanted We encourage anyone to jump in on these. Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Attention The core contributors need to come back around and look at this ASAP. Priority-3 A description (P3) Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests

2 participants