Reimplement NW.js escape to close fullscreen without overriding the global escape key
This commit is contained in:
1 file changed
+5
-4
@@ -582,10 +582,11 @@ class Packager extends EventTarget {
|
||||
policy.ignore();
|
||||
nw.Shell.openExternal(url);
|
||||
});
|
||||
nw.App.registerGlobalHotKey(new nw.Shortcut({
|
||||
key: "Escape",
|
||||
active: () => win.leaveFullscreen()
|
||||
}));
|
||||
document.addEventListener("keydown", (e) => {
|
||||
if (e.key === "Escape" && document.fullscreenElement) {
|
||||
document.exitFullscreen();
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
|
||||
Reference in new issue
Block a user