Skip to content

Commit

Permalink
hey it all works
Browse files Browse the repository at this point in the history
  • Loading branch information
anoadragon453 committed Feb 21, 2019
1 parent 65a501f commit 7ea2073
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
15 changes: 0 additions & 15 deletions electron_app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,6 @@
"minimist": "^1.2.0",
"png-to-ico": "^1.0.2"
},
"iohook": {
"targets": [
"node-64",
"electron-69"
],
"platforms": [
"win32",
"darwin",
"linux"
],
"arches": [
"x64",
"ia32"
]
},
"cmake-js": {
"runtime": "electron",
"runtimeVersion": "4.0.4"
Expand Down
19 changes: 19 additions & 0 deletions src/vector/platform/ElectronPlatform.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,25 @@ export default class ElectronPlatform extends VectorBasePlatform {
ipcRenderer.send('check_updates');
}

startListeningKeys() {
// Tell iohook to start listening for key events
ipcRenderer.send('start-listening-keys');
}

stopListeningKeys() {
// Tell iohook to stop listening for key events
ipcRenderer.send('stop-listening-keys');
}

onKeypress(self: any, callback: (ev, event) => void ) {
ipcRenderer.on('keypress', callback.bind(self));
}

onWindowBlurred(callback: () => void) {
// Callback to run on window blur (window loses focus)
ipcRenderer.on('window-blurred', callback);
}

addGlobalKeybinding(keybindName: string, keybindCode: string, callback: () => void, releaseCallback: () => void) {
// Add a keybinding that works even when the app is minimized
const keybinding = {name: keybindName, code: keybindCode};
Expand Down

0 comments on commit 7ea2073

Please sign in to comment.