mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-11 13:22:39 +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 M_KEY = 77;
|
||||||
const J_KEY = 74;
|
|
||||||
const END_KEY = 35;
|
const END_KEY = 35;
|
||||||
const HOME_KEY = 36;
|
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
|
// Handle CTRL-HOME and CTRL-END
|
||||||
if(((e.keyCode == END_KEY) || (e.keyCode == HOME_KEY)) && liveScroll) this.brewJump();
|
if(((e.keyCode == END_KEY) || (e.keyCode == HOME_KEY)) && liveScroll) this.brewJump();
|
||||||
|
|
||||||
// Brew Jump on CTRL-J
|
// 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
|
// Source Jump on Shift-CTRL-J
|
||||||
if ((e.shiftKey) && (!e.altKey) && (e.keyCode == J_KEY)) this.sourceJump();
|
if ((e.shiftKey) && (!e.altKey) && (e.keyCode == M_KEY)) this.sourceJump();
|
||||||
// Toggle Live-scrolling on Shift-CTRL-ALT-J
|
|
||||||
if((e.shiftKey) && (e.altKey) && (e.keyCode == J_KEY)) {
|
|
||||||
liveScroll = !liveScroll;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( e.keyCode == J_KEY) {
|
if( e.keyCode == M_KEY) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user