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

Reload locale specific data when the input language or method changes #10729

Closed
lhecker opened this issue Jul 20, 2021 · 2 comments · Fixed by #10876
Closed

Reload locale specific data when the input language or method changes #10729

lhecker opened this issue Jul 20, 2021 · 2 comments · Fixed by #10876
Assignees
Labels
Area-i18n Internationalization issues (e.g.: non-US input handling doesn't work) Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Tag-Fix Doesn't match tag requirements Priority-1 A description (P1) Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.

Comments

@lhecker
Copy link
Member

lhecker commented Jul 20, 2021

VkKeyScanW as well as MapVirtualKeyW are widely used throughout the project, but are locale sensitive functions. For instance VkKeyScanW(0) will return different values for "English (United States)" and "English (United Kingdom)". See #8871.

This issue occurs primarily in two areas:

  • The settings model maps characters to virtual keys when deserializing key bindings.
    For instance using the following locale / keyboard layout ctrl+< will deserialize to:
    • German: ctrl+vk(0xE2) (there's a dedicated < key where the \ key is on the US English keyboard)
    • US English: ctrl+shift+vk(0xBC) (< is shift+,)
  • After Introduce vk() and sc() key chord specifiers #10666 has been merged it'll map the scan code in the quake mode key binding win+sc(41) to a virtual key in order to call RegisterHotKey. This scan code to virtual key mappings are highly dependent on the locale, the quake mode key binding will fail to work once the input language was changed.
@lhecker lhecker added Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal. Priority-2 A description (P2) Area-i18n Internationalization issues (e.g.: non-US input handling doesn't work) labels Jul 20, 2021
@lhecker lhecker self-assigned this Jul 20, 2021
@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Jul 20, 2021
@lhecker lhecker added Priority-1 A description (P1) and removed Priority-2 A description (P2) Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Jul 20, 2021
@lhecker lhecker added this to the Terminal v1.11 milestone Jul 20, 2021
@lhecker lhecker changed the title Reload locale specific data on WM_INPUTLANGCHANGE Reload locale specific data when the input language or method changes Jul 27, 2021
@zadjii-msft
Copy link
Member

(notes for posterity, from teams)

(Leonard) tried:

  • WM_INPUTLANGCHANGE -- not being sent to our UWP app (nor any other event when pressing Win+Space)
  • CoreTextServicesManager.InputLanguageChanged -- gets only triggered for input language but not method (aka layout) changes
  • ITfActiveLanguageProfileNotifySink::OnActivated -- not getting called at all
  • XAML's ResourceContext.QualifierValues -- not getting updated

@ghost ghost added the In-PR This issue has a related PR label Aug 5, 2021
@ghost ghost closed this as completed in #10876 Aug 5, 2021
ghost pushed a commit that referenced this issue Aug 5, 2021
`VkKeyScanW` as well as `MapVirtualKeyW` are used throughout
the project, but are input method sensitive functions.

Since #10666 `win+sc(41)` is used as the quake mode keybinding,
which is then mapped to a virtual key in order to call `RegisterHotKey`.
This mapping is highly dependent on the input method and the quake mode
key binding will fail to work once the input method was changed.

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist
* [x] Closes #10729
* [x] I work here
* [ ] Tests added/passed

## Validation Steps Performed

* win+` opens quake window before & after changing keyboard layout ✔️
* keyboard layout changes while WT is minimized trigger reloaded ✔️
@ghost ghost added Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. and removed In-PR This issue has a related PR labels Aug 5, 2021
@ghost
Copy link

ghost commented Aug 31, 2021

🎉This issue was addressed in #10876, which has now been successfully released as Windows Terminal Preview v1.11.2421.0.:tada:

Handy links:

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-i18n Internationalization issues (e.g.: non-US input handling doesn't work) Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Tag-Fix Doesn't match tag requirements Priority-1 A description (P1) Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants