From 15aa2299c3220aa5964981b0958338b6fad1d5b9 Mon Sep 17 00:00:00 2001 From: Vendicated Date: Sat, 7 Jan 2023 22:53:41 +0100 Subject: Add Ctrl+Q Exit shortcut on Windows --- src/patcher.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/patcher.ts b/src/patcher.ts index 0cf7e24..6766e0f 100644 --- a/src/patcher.ts +++ b/src/patcher.ts @@ -17,7 +17,7 @@ */ import { onceDefined } from "@utils/onceDefined"; -import electron, { app, BrowserWindowConstructorOptions } from "electron"; +import electron, { app, BrowserWindowConstructorOptions, globalShortcut } from "electron"; import { readFileSync } from "fs"; import { dirname, join } from "path"; @@ -153,6 +153,13 @@ if (!process.argv.includes("--vanilla")) { responseHeaders["content-type"] = ["text/css"]; } cb({ cancel: false, responseHeaders }); + + + if (process.platform === "win32") { + globalShortcut.register("Control+Q", () => { + app.quit(); + }); + } }); }); } else { -- cgit