Repository: vscode
Issue: macOS accessibility: Releasing ctrl after opening ctrl+tab quick switch menu does not dismiss it, when using Keyboard Viewer or Synergy
Labels: bug,accessibility,quick-pick

<!-- ⚠️⚠️ Do Not Delete This! bug_report_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- 🕮 Read our guide about submitting issues: https://github.com/microsoft/vscode/wiki/Submitting-Bugs-and-Suggestions -->
<!-- 🔎 Search existing issues to avoid creating duplicates. -->
<!-- 🧪 Test using the latest Insiders build to see if your issue has already been fixed: https://code.visualstudio.com/insiders/ -->
<!-- 💡 Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. -->
<!-- 🔧 Launch with `code --disable-extensions` to check. -->
Does this issue occur when all extensions are disabled?: Yes

<!-- 🪓 If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. -->
<!-- 📣 Issues caused by an extension need to be reported directly to the extension publisher. The 'Help > Report Issue' dialog can assist with this. -->
- VS Code Version: 1.65.1 (Universal)
- OS Version: macOS 12.2.1 (21D62)

Steps to Reproduce:

My personal complaint here is when using VSCode through Synergy, but the same issue is present when using macOS's own built-in Keyboard Viewer, so this looks like an accessibility bug beyond an arbitrary side-effect of some third-party software.

Keyboard Viewer steps:

1. In VSCode for Mac, open multiple files
2. Open the [Keyboard Viewer](https://support.apple.com/guide/mac-help/use-the-keyboard-viewer-on-mac-mchlp1015/mac) accessibility tool
3. Click the ctrl key
4. Click the tab key
5. See that the VSCode quick switch menu opens
6. See that the keyboard state no longer has the ctrl key held
7. **See that the VSCode quick switch menu is still open** <-- problem
8. (The menu can still be dismissed/accepted by clicking the ctrl key on and off again, or with the enter key)

Synergy steps:

1. Get a Mac and a Windows PC on the same network
9. Install VSCode and [Synergy](https://symless.com/synergy) (1.14.3) on the Mac
10. Install [Synergy](https://symless.com/synergy) (1.14.3) on the PC
11. Configure Synergy to send the PC mouse+keyboard input to the Mac
12. In VSCode on the Mac, open multiple files
13. Verifying behavior of non-Synergy UX:
14. Using a keyboard **directly attached to the Mac**...
15. ...**hold** ctrl
16. ...**press** tab
17. ...see that the VSCode quick switch menu opens
18. ...**release** ctrl
19. ...see that the VSCode quick switch menu closes
20. Demonstrating buggy behavior of Synergy UX:
21. Using **Synergy** to send keyboard input **from the PC to the Mac** over the network...
22. ...**hold** ctrl
23. ...**press** tab
24. ...see that the VSCode quick switch menu opens
25. ...**release** ctrl
26. ...**see that the VSCode quick switch menu is still open!** <-- problem
27. (The menu can still be dismissed/accepted with the enter key)

You can further verify that both Keyboard Viewer and Synergy seem to be maintaining the correct keyboard state by using KeyCastr on the Mac (with KeyCastr's "Svelte" visualizer selected). KeyCastr shows that the ctrl key is released, but VSCode still keeps the quick switch menu open.