-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Open
Labels
Area-InputRelated to input processing (key presses, mouse, etc.)Related to input processing (key presses, mouse, etc.)Area-TerminalControlIssues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.)Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.)Issue-BugIt either shouldn't be doing this or needs an investigation.It either shouldn't be doing this or needs an investigation.Priority-2A description (P2)A description (P2)Product-TerminalThe new Windows Terminal.The new Windows Terminal.
Milestone
Description
Environment
Windows build number: 10.0.19042.0
Steps to reproduce
- Add the "US" keyboard layout within the "English (United States)" language
- Add the "United Kingdom Extended" layout within the "English (United Kingdom)" language
- Run the following code:
#define NOMINMAX #include <Windows.h> #include <cstdio> int main() { while (true) { printf("0x%x\n", LOBYTE(VkKeyScanW(0))); Sleep(1000); } return 0; }
- Change the keyboard layout using Win+Space or similar
Expected behavior
VkKeyScanW(0) prints 0x32 if the US and 0x40 if the UK layout is selected. The value changes during runtime if the layout is changed.
Actual behavior
VkKeyScanW(0) will continue to return its initial value and not change if the keyboard layout is changed during runtime. MapVirtualKeyW appears similarly affected. (I haven't tried to reproduce this yet though.)
This has far reaching implications due to the widespread use of these functions in this code base and manifests itself in key combinations either not working at all, or producing incorrect VT sequences. The only way to fix the issue is by restarting the application.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Area-InputRelated to input processing (key presses, mouse, etc.)Related to input processing (key presses, mouse, etc.)Area-TerminalControlIssues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.)Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.)Issue-BugIt either shouldn't be doing this or needs an investigation.It either shouldn't be doing this or needs an investigation.Priority-2A description (P2)A description (P2)Product-TerminalThe new Windows Terminal.The new Windows Terminal.