mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-26 03:02:40 +00:00
Update Jump keys to match parent PR and shift live scrolling to scroll-lock.
Needs non-PC testing.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user