From 0b0452884211f80e3c73788eb55c91665f793aab Mon Sep 17 00:00:00 2001 From: talksik Date: Sun, 24 Apr 2022 08:08:44 -0500 Subject: [PATCH] global shortcut, but need something for onhold --- packages/desktop/src/index.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/desktop/src/index.ts b/packages/desktop/src/index.ts index c8b1c13..a330b44 100644 --- a/packages/desktop/src/index.ts +++ b/packages/desktop/src/index.ts @@ -1,4 +1,4 @@ -import { BrowserWindow, app, dialog, ipcMain } from "electron"; +import { BrowserWindow, app, dialog, globalShortcut, ipcMain } from "electron"; import Channels, { Dimensions } from "./electron/constants"; import { handleGoogleLogin } from "./electron/handleLogin"; @@ -68,6 +68,11 @@ app browserWindow.setSize(width, height, false); }); + }) + .then(() => { + globalShortcut.register("`", () => { + console.log("Electron loves global shortcuts!"); + }); }); // Quit when all windows are closed, except on macOS. There, it's common