Skip to content

Commit 1422661

Browse files
committed
Ticket #133 #127 - A new fix for the sticky alt key state on windows to handle allkey combos including ones that arent shortcuts
1 parent ce59ea0 commit 1422661

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

epiceditor/js/epiceditor.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -739,20 +739,23 @@
739739
if (isMod === true && e.keyCode == self.settings.shortcut.preview && !self.eeState.fullscreen) {
740740
e.preventDefault();
741741
self.preview();
742-
isMod = false;
743742
}
744743
// Check for alt+o - default shortcut to switch back to the editor
745744
if (isMod === true && e.keyCode == self.settings.shortcut.edit) {
746745
e.preventDefault();
747746
if (!self.eeState.fullscreen) {
748747
self.edit();
749748
}
750-
isMod = false;
751749
}
752750
// Check for alt+f - default shortcut to make editor fullscreen
753751
if (isMod === true && e.keyCode == self.settings.shortcut.fullscreen) {
754752
e.preventDefault();
755753
_goFullscreen(fsElement);
754+
}
755+
756+
// Set the modifier key to false once *any* key combo is completed
757+
// or else, on Windows, hitting the alt key will lock the isMod state to true (ticket #133)
758+
if (isMod === true && e.keyCode !== self.settings.shortcut.modifier) {
756759
isMod = false;
757760
}
758761

0 commit comments

Comments
 (0)