From 86887b536ef18d6432f65dd53f9c50f9fd88d32f Mon Sep 17 00:00:00 2001 From: David Bolack Date: Sun, 19 May 2024 11:16:50 -0500 Subject: [PATCH] Update Jump keys to match parent PR and shift live scrolling to scroll-lock. Needs non-PC testing. --- client/homebrew/editor/editor.jsx | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/client/homebrew/editor/editor.jsx b/client/homebrew/editor/editor.jsx index b08ee9a2b..7879b9941 100644 --- a/client/homebrew/editor/editor.jsx +++ b/client/homebrew/editor/editor.jsx @@ -117,24 +117,26 @@ const Editor = createClass({ } } } - if(!(e.ctrlKey || e.metaKey)) return; - const J_KEY = 74; + const M_KEY = 77; const END_KEY = 35; const HOME_KEY = 36; + const SCROLLLOCK_KEY = 145; + + // Toggle Live-scrolling on Scroll Lock + if(e.keyCode == SCROLLLOCK_KEY) { + liveScroll = !liveScroll; + } + if(!(e.ctrlKey || e.metaKey)) return; // Handle CTRL-HOME and CTRL-END if(((e.keyCode == END_KEY) || (e.keyCode == HOME_KEY)) && liveScroll) this.brewJump(); // Brew Jump on CTRL-J - if((!e.shiftKey) && (e.keyCode == J_KEY)) this.brewJump(); + if((!e.shiftKey) && (e.keyCode == M_KEY)) this.brewJump(); // Source Jump on Shift-CTRL-J - if ((e.shiftKey) && (!e.altKey) && (e.keyCode == J_KEY)) this.sourceJump(); - // Toggle Live-scrolling on Shift-CTRL-ALT-J - if((e.shiftKey) && (e.altKey) && (e.keyCode == J_KEY)) { - liveScroll = !liveScroll; - } + if ((e.shiftKey) && (!e.altKey) && (e.keyCode == M_KEY)) this.sourceJump(); - if( e.keyCode == J_KEY) { + if( e.keyCode == M_KEY) { e.stopPropagation(); e.preventDefault(); }