Add Ctrl+Q Exit shortcut on Windows
This commit is contained in:
parent
06aa72c636
commit
15aa2299c3
1 changed files with 8 additions and 1 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue