From f9b4c85fdc7ff9b5b0bc90237f88c6f7709ada2f Mon Sep 17 00:00:00 2001 From: tillvit Date: Wed, 14 Aug 2024 14:33:53 -0700 Subject: [PATCH] fFix Cmd-W to close NWJS window --- app/src/App.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/App.ts b/app/src/App.ts index f6fc9110..a6e996c9 100644 --- a/app/src/App.ts +++ b/app/src/App.ts @@ -83,7 +83,8 @@ export class App { if (window.nw) { const win = nw.Window.get() - nw.App.on("open", () => { + nw.App.on("open", args => { + console.log(args) nw.Window.open(window.location.href) }) @@ -92,7 +93,7 @@ export class App { e.preventDefault() win.reload() } - if (e.key == "w" && (e.metaKey || e.ctrlKey)) { + if (e.code == "KeyW" && (e.metaKey || e.ctrlKey)) { e.preventDefault() win.close() }