From ab3a9076d90f17ee4d063495fd9f8df8b273cffd Mon Sep 17 00:00:00 2001 From: Oliver Eyton-Williams Date: Tue, 17 Sep 2019 18:40:11 +0200 Subject: [PATCH] fix: change hotkeys to work across platforms Co-authored-by: moT01 --- client/src/templates/Challenges/classic/Editor.js | 4 ++-- .../src/templates/Challenges/components/Challenge-Title.js | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/client/src/templates/Challenges/classic/Editor.js b/client/src/templates/Challenges/classic/Editor.js index 1ab4070708..8e82b2a873 100644 --- a/client/src/templates/Challenges/classic/Editor.js +++ b/client/src/templates/Challenges/classic/Editor.js @@ -128,7 +128,7 @@ class Editor extends Component { keybindings: [ /* eslint-disable no-bitwise */ monaco.KeyMod.chord( - monaco.KeyMod.CtrlCmd | monaco.KeyMod.Shift | monaco.KeyCode.PageDown + monaco.KeyMod.CtrlCmd | monaco.KeyMod.Shift | monaco.KeyCode.US_COMMA ) ], run: () => navigate(this.props.prevChallengePath) @@ -139,7 +139,7 @@ class Editor extends Component { keybindings: [ /* eslint-disable no-bitwise */ monaco.KeyMod.chord( - monaco.KeyMod.CtrlCmd | monaco.KeyMod.Shift | monaco.KeyCode.PageUp + monaco.KeyMod.CtrlCmd | monaco.KeyMod.Shift | monaco.KeyCode.US_DOT ) ], run: () => navigate(this.props.nextChallengePath) diff --git a/client/src/templates/Challenges/components/Challenge-Title.js b/client/src/templates/Challenges/components/Challenge-Title.js index 4bc702bf09..bf20e04e24 100644 --- a/client/src/templates/Challenges/components/Challenge-Title.js +++ b/client/src/templates/Challenges/components/Challenge-Title.js @@ -8,8 +8,8 @@ import './challenge-title.css'; import GreenPass from '../../../assets/icons/GreenPass'; const keyMap = { - NAVIGATE_PREV: 'ctrl+shift+pagedown', - NAVIGATE_NEXT: 'ctrl+shift+pageup' + NAVIGATE_PREV: ['ctrl+shift+<', 'cmd+shift+<'], + NAVIGATE_NEXT: ['ctrl+shift+>', 'cmd+shift+>'] }; const propTypes = { @@ -33,7 +33,6 @@ function ChallengeTitle({ NAVIGATE_PREV: () => navigate(prevChallengePath), NAVIGATE_NEXT: () => navigate(nextChallengePath) }; - return (