Skip to content

Partially fix mapping of virtual keys to characters - #2836

Merged
Mike Griese (zadjii-msft) merged 1 commit into
microsoft:masterfrom
lhecker:fix-vkey-char-mapping
Oct 1, 2019
Merged

Mike Griese (zadjii-msft) merged 1 commit into
microsoft:masterfrom
lhecker:fix-vkey-char-mapping

Conversation

@lhecker

@lhecker Leonard Hecker (lhecker) commented Sep 21, 2019 •

Copy link
Copy Markdown
Member

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

Comment thread src/cascadia/TerminalCore/Terminal.cpp Resolved
Comment thread src/cascadia/TerminalCore/Terminal.cpp Resolved
Comment thread src/cascadia/TerminalCore/Terminal.cpp 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
Copy Markdown
Member Author

Carlos Zamora (@carlos-zamora) I believe your review comments should be addressed now. 🙂

@lhecker

Copy link
Copy Markdown
Member Author

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
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
Member Author

Mike Griese (@zadjii-msft) Dustin L. Howett (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
Copy Markdown
Member Author

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

@zadjii-msft

Copy link
Copy Markdown
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
Copy Markdown

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

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Shift key not working properly in some situations Alt+Shift+comma emit Alt + comma, it should emit Alt + [less than sign]

4 participants