feat: Add dynamic keycode for primary modifier key by gonfunko · Pull Request #9571 · RaspberryPiFoundation/blockly

Skip to content

Navigation Menu

Sign in

Appearance settings

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Conversation

@gonfunko

Copy link Copy Markdown

Contributor

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 gonfunko requested a review from a team as a code owner

January 14, 2026 22:17

@gonfunko gonfunko requested a review from BenHenning

January 14, 2026 22:17

@github-actions github-actions bot added the PR: feature

Adds a feature

label

Jan 14, 2026
Copy link Copy Markdown

Collaborator

@BenHenning 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.

@BenHenning BenHenning assigned gonfunko and unassigned BenHenning

Jan 16, 2026
Copy link Copy Markdown

Collaborator

@BenHenning 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!

@gonfunko gonfunko merged commit 3b14950 into main

Feb 25, 2026

7 checks passed

@gonfunko gonfunko deleted the modifier-keys branch

February 25, 2026 16:51

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@BenHenning BenHenning BenHenning approved these changes

Labels

PR: feature

Adds a feature

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Add a custom key code that means "control on windows and command on mac"

2 participants

@gonfunko @BenHenning