Add Ctrl+Q Exit shortcut on Windows
This commit is contained in:
parent
06aa72c636
commit
15aa2299c3
@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { onceDefined } from "@utils/onceDefined";
|
import { onceDefined } from "@utils/onceDefined";
|
||||||
import electron, { app, BrowserWindowConstructorOptions } from "electron";
|
import electron, { app, BrowserWindowConstructorOptions, globalShortcut } from "electron";
|
||||||
import { readFileSync } from "fs";
|
import { readFileSync } from "fs";
|
||||||
import { dirname, join } from "path";
|
import { dirname, join } from "path";
|
||||||
|
|
||||||
@ -153,6 +153,13 @@ if (!process.argv.includes("--vanilla")) {
|
|||||||
responseHeaders["content-type"] = ["text/css"];
|
responseHeaders["content-type"] = ["text/css"];
|
||||||
}
|
}
|
||||||
cb({ cancel: false, responseHeaders });
|
cb({ cancel: false, responseHeaders });
|
||||||
|
|
||||||
|
|
||||||
|
if (process.platform === "win32") {
|
||||||
|
globalShortcut.register("Control+Q", () => {
|
||||||
|
app.quit();
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user