Fix: Prevent Shift key from intercepting shortcuts in Web Custom Editors#322680
Open
Tejas-Raj01 wants to merge 3 commits into
Open
Fix: Prevent Shift key from intercepting shortcuts in Web Custom Editors#322680Tejas-Raj01 wants to merge 3 commits into
Tejas-Raj01 wants to merge 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request addresses a VS Code for the Web issue where Shift was treated like an “alternative actions” modifier for custom editor toolbars/menus, which could interfere with normal Shift+… keybindings (e.g. Markdown preview toggle).
Changes:
- Disable using
Shiftas an alternative-actions modifier when running in the Web environment (isWeb) for context menu action resolution. - Disable using
Shift(while hovered) to toggle an action’s alternate command in the Web environment, leavingAltas the modifier.
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.
Fixes #322505
Description
This PR fixes an issue in the Web environment where the
Shiftkey incorrectly intercepts keyboard shortcuts in Custom Editors.Previously, holding the
Shiftkey would trigger the alternative actions state (toggling toolbar icons), which prevented standard shortcuts involving theShiftkey (likeShift+Cmd/Ctrl+Vfor toggling Markdown preview) from executing properly in web custom editors. This fix ensures that the alternative action state bypasses theShiftkey check when running in the Web environment (isWeb).How to test
./scripts/code-web.shor vscode.dev).Shiftkey (likeShift+Cmd+Von Mac orShift+Ctrl+Von Windows/Linux).