forked from matrix/element-web
hey it all works
This commit is contained in:
parent
65a501ff2b
commit
7ea207327f
|
@ -12,21 +12,6 @@
|
||||||
"minimist": "^1.2.0",
|
"minimist": "^1.2.0",
|
||||||
"png-to-ico": "^1.0.2"
|
"png-to-ico": "^1.0.2"
|
||||||
},
|
},
|
||||||
"iohook": {
|
|
||||||
"targets": [
|
|
||||||
"node-64",
|
|
||||||
"electron-69"
|
|
||||||
],
|
|
||||||
"platforms": [
|
|
||||||
"win32",
|
|
||||||
"darwin",
|
|
||||||
"linux"
|
|
||||||
],
|
|
||||||
"arches": [
|
|
||||||
"x64",
|
|
||||||
"ia32"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"cmake-js": {
|
"cmake-js": {
|
||||||
"runtime": "electron",
|
"runtime": "electron",
|
||||||
"runtimeVersion": "4.0.4"
|
"runtimeVersion": "4.0.4"
|
||||||
|
|
|
@ -218,6 +218,25 @@ export default class ElectronPlatform extends VectorBasePlatform {
|
||||||
ipcRenderer.send('check_updates');
|
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) {
|
addGlobalKeybinding(keybindName: string, keybindCode: string, callback: () => void, releaseCallback: () => void) {
|
||||||
// Add a keybinding that works even when the app is minimized
|
// Add a keybinding that works even when the app is minimized
|
||||||
const keybinding = {name: keybindName, code: keybindCode};
|
const keybinding = {name: keybindName, code: keybindCode};
|
||||||
|
|
Loading…
Reference in New Issue