add cmd-l listener

This commit is contained in:
sawka 2022-10-07 14:36:34 -07:00
parent 82e88d2f61
commit 0053ebbfa9
2 changed files with 6 additions and 0 deletions

View File

@ -110,6 +110,11 @@ function createMainWindow(clientData) {
}
return;
}
if (input.code == "KeyL" && input.meta) {
win.webContents.send("l-cmd", mods);
e.preventDefault();
return;
}
if (input.code == "KeyW" && input.meta) {
e.preventDefault();
win.webContents.send("w-cmd", mods);

View File

@ -4,6 +4,7 @@ contextBridge.exposeInMainWorld("api", {
getId: () => ipcRenderer.sendSync("get-id"),
onTCmd: (callback) => ipcRenderer.on("t-cmd", callback),
onICmd: (callback) => ipcRenderer.on("i-cmd", callback),
onLCmd: (callback) => ipcRenderer.on("l-cmd", callback),
onHCmd: (callback) => ipcRenderer.on("h-cmd", callback),
onWCmd: (callback) => ipcRenderer.on("w-cmd", callback),
onMetaArrowUp: (callback) => ipcRenderer.on("meta-arrowup", callback),