feat: Add dynamic keycode for primary modifier key by gonfunko · Pull Request #9571 · RaspberryPiFoundation/blockly
Navigation Menu
{{ message }}
RaspberryPiFoundation / blockly Public
- Notifications You must be signed in to change notification settings
- Fork 3.8k
Merged
feat: Add dynamic keycode for primary modifier key#9571
feat: Add dynamic keycode for primary modifier key#9571
Conversation
Copy link Copy Markdown
Contributor
gonfunko
commented
Jan 14, 2026
gonfunko
commented
The basics
The details
Resolves
Fixes #8836
Proposed Changes
This PR adds KeyCodes.CTRL_CMD, which dynamically resolves to either Control or Command depending on the current platform. This allows keyboard shortcuts to be registered with the expected modifier key on all platforms, and without also being registered for other platforms' modifier key.
gonfunko
requested a review
from a team
as a code owner
gonfunko
requested a review
from BenHenning
github-actions
bot
assigned
BenHenning
BenHenning reviewed Jan 16, 2026
Copy link Copy Markdown
Collaborator
BenHenning
left a comment
BenHenning
left a comment
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @gonfunko! It's a nice simplification. I have a couple of suggestions, PTAL.
core/utils/keycodes.ts
Outdated
Show resolved
Hide resolved
core/utils/keycodes.ts Outdated Show resolved Hide resolved
packages/blockly/tests/mocha/shortcut_items_test.js
Show resolved
Hide resolved
packages/blockly/tests/mocha/shortcut_items_test.js Show resolved Hide resolved
BenHenning
assigned
gonfunko and unassigned
BenHenning
gonfunko
assigned
BenHenning
BenHenning approved these changes Feb 25, 2026
Copy link Copy Markdown
Collaborator
BenHenning
left a comment
BenHenning
left a comment
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, this dropped off my radar.
Thanks @gonfunko. LGTM!
packages/blockly/tests/mocha/shortcut_items_test.js
Show resolved
Hide resolved
packages/blockly/tests/mocha/shortcut_items_test.js Show resolved Hide resolved
gonfunko
deleted the
modifier-keys
branch
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