Fix cursor being hidden when pressing modifier keys#19473
Merged
lhecker merged 2 commits intomicrosoft:mainfrom Oct 21, 2025
Merged
Fix cursor being hidden when pressing modifier keys#19473lhecker merged 2 commits intomicrosoft:mainfrom
lhecker merged 2 commits intomicrosoft:mainfrom
Conversation
Added a check to ensure IslandWindow::HideCursor() is only called when a non-modifier key (e.g., not Shift, Control, Alt, or Windows keys) is pressed. This prevents unintended cursor hiding when only modifier keys are used.
|
Thanks for the review. I'm excited to contribute to this project. I'm available to make any requested changes quickly! |
lhecker
reviewed
Oct 20, 2025
Comment on lines
+489
to
+496
| const bool modifierKey = (msg.wParam == VK_SHIFT || | ||
| msg.wParam == VK_CONTROL || | ||
| msg.wParam == VK_MENU || | ||
| msg.wParam == VK_LWIN || | ||
| msg.wParam == VK_RWIN); | ||
|
|
||
| // Hide the cursor only when the key pressed is not a modifier key. | ||
| if (!modifierKey) |
Member
There was a problem hiding this comment.
Thank you for working on this. Elsewhere we have this function:
terminal/src/cascadia/TerminalCore/Terminal.hpp
Lines 66 to 80 in b8f35a3
Perhaps we should copy it verbatim here and use it?
Contributor
Author
There was a problem hiding this comment.
Hi! Thanks for the feedback :)
I've refactored the code following your advice, and re-tested it
Introduce IsInputKey function, coppied from Terminal.hpp, for improving the modifier key handling logic and following the codebase standards. Update cursor hiding logic to use the new function.
Contributor
Author
|
@microsoft-github-policy-service agree |
lhecker
approved these changes
Oct 20, 2025
Member
lhecker
left a comment
There was a problem hiding this comment.
Thank you for doing this!
At some point in the future we can think about how to unify the IsInputKey copies, but not today. :)
Member
|
/azp run |
Member
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
DHowett
pushed a commit
that referenced
this pull request
Dec 17, 2025
DHowett
pushed a commit
that referenced
this pull request
Dec 17, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of the Pull Request
Added a check to ensure IslandWindow::HideCursor() is only called when a non-modifier key (e.g., not Shift, Control, Alt, or Windows keys) is pressed. This prevents unintended cursor hiding when only modifier keys are used.
References and Relevant Issues
19445 - The mouse pointer has disappeared when press CTRL or SHIFT
Detailed Description of the Pull Request / Additional comments
Validation Steps Performed
Built and deployed CascadiaPackage through VS, tested the deployed Terminal Dev app on local machine.
PR Checklist