Skip to content

Fix: Prevent Shift key from intercepting shortcuts in Web Custom Editors#322680

Open
Tejas-Raj01 wants to merge 3 commits into
microsoft:mainfrom
Tejas-Raj01:fix-web-custom-editor-shortcuts
Open

Fix: Prevent Shift key from intercepting shortcuts in Web Custom Editors#322680
Tejas-Raj01 wants to merge 3 commits into
microsoft:mainfrom
Tejas-Raj01:fix-web-custom-editor-shortcuts

Conversation

@Tejas-Raj01

Copy link
Copy Markdown

Fixes #322505

Description

This PR fixes an issue in the Web environment where the Shift key incorrectly intercepts keyboard shortcuts in Custom Editors.

Previously, holding the Shift key would trigger the alternative actions state (toggling toolbar icons), which prevented standard shortcuts involving the Shift key (like Shift+Cmd/Ctrl+V for toggling Markdown preview) from executing properly in web custom editors. This fix ensures that the alternative action state bypasses the Shift key check when running in the Web environment (isWeb).

How to test

  1. Open VS Code in a web environment (e.g., ./scripts/code-web.sh or vscode.dev).
  2. Open a Markdown file and its custom preview.
  3. Press a keyboard shortcut that includes the Shift key (like Shift+Cmd+V on Mac or Shift+Ctrl+V on Windows/Linux).
  4. Verify that the shortcut successfully toggles the preview editor instead of merely toggling the alternative actions in the editor toolbar.

Copilot AI review requested due to automatic review settings June 24, 2026 08:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Shift as 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, leaving Alt as the modifier.

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.

Keyboard shortcut for Custom Editor not working on VS Code for the web

2 participants