[PR #4965] [MERGED] Ignore KeyDown events during Alt-Numpad Input #26063

Open
opened 2026-01-31 09:13:41 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/4965
Author: @leonMSFT
Created: 3/17/2020
Status: Merged
Merged: 3/18/2020
Merged by: @undefined

Base: masterHead: dev/lelian/altnumpad


📝 Commits (3)

📊 Changes

1 file changed (+10 additions, -0 deletions)

View changed files

📝 src/cascadia/TerminalControl/TermControl.cpp (+10 -0)

📄 Description

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.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/4965 **Author:** [@leonMSFT](https://github.com/leonMSFT) **Created:** 3/17/2020 **Status:** ✅ Merged **Merged:** 3/18/2020 **Merged by:** [@undefined](undefined) **Base:** `master` ← **Head:** `dev/lelian/altnumpad` --- ### 📝 Commits (3) - [`2ea0b84`](https://github.com/microsoft/terminal/commit/2ea0b84b677f72a50ce853049eacbabb52d8fcce) ignore alt numpad keydowns - [`30934c9`](https://github.com/microsoft/terminal/commit/30934c9d3c2d0bc206665ae234be283cb8392544) comments - [`c94127f`](https://github.com/microsoft/terminal/commit/c94127fb9c45c261faf80236d00100ad186049c1) linking gh issue in comment ### 📊 Changes **1 file changed** (+10 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalControl/TermControl.cpp` (+10 -0) </details> ### 📄 Description ## 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:13:41 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#26063