From 404a14ce030b57ca4fade3e51890df64d18efbac Mon Sep 17 00:00:00 2001 From: Tom <20648924+moT01@users.noreply.github.com> Date: Fri, 19 Aug 2022 06:34:06 -0500 Subject: [PATCH] fix: make ctrl+enter work on mac (#47303) --- .../src/templates/Challenges/classic/editor.tsx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/client/src/templates/Challenges/classic/editor.tsx b/client/src/templates/Challenges/classic/editor.tsx index 560bdf907ff..31cde98b979 100644 --- a/client/src/templates/Challenges/classic/editor.tsx +++ b/client/src/templates/Challenges/classic/editor.tsx @@ -431,7 +431,10 @@ const Editor = (props: EditorProps): JSX.Element => { id: 'execute-challenge', label: 'Run tests', /* eslint-disable no-bitwise */ - keybindings: [monaco.KeyMod.CtrlCmd | monaco.KeyCode.Enter], + keybindings: [ + monaco.KeyMod.CtrlCmd | monaco.KeyCode.Enter, + monaco.KeyMod.WinCtrl | monaco.KeyCode.Enter + ], run: () => { if (props.usesMultifileEditor && !isFinalProject(props.challengeType)) { if (challengeIsComplete()) { @@ -456,7 +459,10 @@ const Editor = (props: EditorProps): JSX.Element => { editor.addAction({ id: 'save-editor-content', label: 'Save editor content', - keybindings: [monaco.KeyMod.CtrlCmd | monaco.KeyCode.KEY_S], + keybindings: [ + monaco.KeyMod.CtrlCmd | monaco.KeyCode.KEY_S, + monaco.KeyMod.WinCtrl | monaco.KeyCode.KEY_S + ], run: props.challengeType === challengeTypes.multifileCertProject && props.isSignedIn @@ -468,7 +474,10 @@ const Editor = (props: EditorProps): JSX.Element => { editor.addAction({ id: 'toggle-accessibility', label: 'Toggle Accessibility Mode', - keybindings: [monaco.KeyMod.CtrlCmd | monaco.KeyCode.KEY_E], + keybindings: [ + monaco.KeyMod.CtrlCmd | monaco.KeyCode.KEY_E, + monaco.KeyMod.WinCtrl | monaco.KeyCode.KEY_E + ], run: () => { const currentAccessibility = storedAccessibilityMode();