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

Partially fix mapping of virtual keys to characters #2836

Merged
merged 1 commit into from
Oct 1, 2019
Merged

Partially fix mapping of virtual keys to characters #2836

merged 1 commit into from
Oct 1, 2019

Conversation

lhecker
Copy link
Member

@lhecker lhecker commented Sep 21, 2019

Summary of the Pull Request

This PR mostly fixes the mapping of Alt combinations to unicode characters.

The case of AltGr was originally hotfixed by returning early in TerminalControl.
But this didn't fix e.g. AltShift combinations. See #2771 for instance.

This PR now fixes this particular remaining issue.
Cases where a single keypress generates more than a single UTF-16 code point (e.g. when diacritics come into play) are not fixed though, due to a limitation in the design of the low level KeyEvent class.

PR Checklist

Detailed Description of the Pull Request / Additional comments

This removes the special handling of AltGr in TerminalControl, so that terminalInput may now handle it by itself.

I believe it'd be nice to extend InputTest.cpp to include a test for the translation of Shift. to ">", but unfortunately this would be exclusive to US keyboard layouts.
My german keyboard layout for instance uses Shift< for this (there's a dedicated "<" key).
How would I build a unit test for this that works independent of "internationalization"?

Validation Steps Performed

src/cascadia/TerminalCore/Terminal.cpp Show resolved Hide resolved
src/cascadia/TerminalCore/Terminal.cpp Show resolved Hide resolved
src/cascadia/TerminalCore/Terminal.cpp Outdated Show resolved Hide resolved
@ghost ghost added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Sep 23, 2019
@lhecker
Copy link
Member Author

lhecker commented Sep 23, 2019

@carlos-zamora I believe your review comments should be addressed now. 🙂

@lhecker
Copy link
Member Author

lhecker commented Sep 23, 2019

I believe the tests are failing due to some recent commit in master? I don't think I caused these issues.

@DHowett-MSFT
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ghost ghost added the No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. label Oct 1, 2019
@ghost
Copy link

ghost commented Oct 1, 2019

This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment.

@lhecker
Copy link
Member Author

lhecker commented Oct 1, 2019

@zadjii-msft @DHowett-MSFT This PR just got a No-Recent-Activity tag even though it's approved. 😕

@ghost ghost removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. labels Oct 1, 2019
@lhecker
Copy link
Member Author

lhecker commented Oct 1, 2019

Ah, my comment removed the tag. 😄 Anyways… Do you know when (or if) this will be merged?

@zadjii-msft
Copy link
Member

Whoops, that's on us. I think we were holding it since we were about to release v0.5, but now that 0.5 is out, let's get this in :)

@ghost
Copy link

ghost commented Oct 4, 2019

🎉Windows Terminal Preview v0.5.2762.0 has been released which incorporates this pull request.:tada:

Handy links:

@lhecker lhecker restored the fix-vkey-char-mapping branch October 8, 2019 08:12
@lhecker lhecker deleted the fix-vkey-char-mapping branch October 8, 2019 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants