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

Ignore KeyDown events during Alt-Numpad Input #4965

Merged
3 commits merged into from
Mar 18, 2020
Merged

Conversation

leonMSFT
Copy link
Contributor

Summary of the Pull Request

Alt-Numpad# input would be escaping each numkey before sending it through. This would result in some weird behavior, for example, in powershell, where the first alt-numpad# would start digit argument and once the user releases alt, a character is sent through and digit argument would repeat that character X times. To resolve this, we simply need to ignore KeyDowns where Alt is held and a Numpad# is pressed.

Once Alt is released, we'll receive a character through TSFInputControl, not TermControl::CharacterHandler. It seems that the CoreTextEditContext in TSFInputControl intercepts the character before it gets to TermControl. TSF will then send the received character through as normal.

PR Checklist

Validation Steps Performed

Testing various combinations of Alt-Numpad# consistently sends through only one instance of the expected symbols.

@zadjii-msft zadjii-msft added Area-Input Related to input processing (key presses, mouse, etc.) Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Product-Terminal The new Windows Terminal. Needs-Second It's a PR that needs another sign-off labels Mar 17, 2020
@ghost ghost requested review from miniksa, carlos-zamora and DHowett-MSFT March 17, 2020 21:17
Co-Authored-By: Mike Griese <[email protected]>
@leonMSFT leonMSFT added the AutoMerge Marked for automatic merge by the bot when requirements are met label Mar 18, 2020
@ghost
Copy link

ghost commented Mar 18, 2020

Hello @leonMSFT!

Because this pull request has the AutoMerge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@ghost ghost merged commit cddac25 into master Mar 18, 2020
@ghost ghost deleted the dev/lelian/altnumpad branch March 18, 2020 17:58
DHowett-MSFT pushed a commit that referenced this pull request Mar 19, 2020
## Summary of the Pull Request
Alt-Numpad# input would be escaping each numkey before sending it through. This would result in some weird behavior, for example, in powershell, where the first alt-numpad# would start digit argument and once the user releases alt, a character is sent through and digit argument would repeat that character X times. To resolve this, we simply need to ignore KeyDowns where Alt is held and a Numpad# is pressed.

Once Alt is released, we'll receive a character through `TSFInputControl`, not `TermControl::CharacterHandler`. It seems that the `CoreTextEditContext` in `TSFInputControl` intercepts the character before it gets to `TermControl`. TSF will then send the received character through as normal.

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist
* [x] Closes #1401
* [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA
* [x] Tests added/passed

<!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed
Testing various combinations of Alt-Numpad# consistently sends through only one instance of the expected symbols.

(cherry picked from commit cddac25)
@ghost
Copy link

ghost commented Mar 20, 2020

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

Handy links:

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Input Related to input processing (key presses, mouse, etc.) Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) AutoMerge Marked for automatic merge by the bot when requirements are met Needs-Second It's a PR that needs another sign-off Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TerminalControl handles ALT+NUMPAD input poorly
3 participants