mirror of
https://github.com/danbulant/console-hub
synced 2026-07-06 03:21:01 +00:00
Update keySend
This commit is contained in:
parent
fa882c2f97
commit
268b15a374
1 changed files with 10 additions and 2 deletions
12
main.js
12
main.js
|
|
@ -28,6 +28,7 @@ function createWindow () {
|
||||||
width: 800,
|
width: 800,
|
||||||
height: 600,
|
height: 600,
|
||||||
frame: true,
|
frame: true,
|
||||||
|
fullScreen: true,
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
nodeIntegration: true,
|
nodeIntegration: true,
|
||||||
nodeIntegrationInWorker: true,
|
nodeIntegrationInWorker: true,
|
||||||
|
|
@ -174,9 +175,16 @@ ipcMain.on('fullscreen', (event, arg) => {
|
||||||
console.log('Setting to fullscreen ' + arg);
|
console.log('Setting to fullscreen ' + arg);
|
||||||
win.setFullScreen(arg);
|
win.setFullScreen(arg);
|
||||||
})
|
})
|
||||||
ipcMain.on('sendKeys', (event, arg) => {
|
|
||||||
|
function sendKeybinding (win, modifiers, keyCode) {
|
||||||
|
win.webContents.sendInputEvent({ type: 'keyDown', modifiers, keyCode })
|
||||||
|
win.webContents.sendInputEvent({ type: 'char', modifiers, keyCode })
|
||||||
|
win.webContents.sendInputEvent({ type: 'keyUp', modifiers, keyCode })
|
||||||
|
}
|
||||||
|
|
||||||
|
ipcMain.on('sendKeys', (event, modifiers, keyCode) => {
|
||||||
console.log('Sending keys: '+arg);
|
console.log('Sending keys: '+arg);
|
||||||
sendkeys.send(arg);
|
sendKeybinding(win, modifiers, keyCode);
|
||||||
})
|
})
|
||||||
ipcMain.on('listFiles', (event, arg) => {
|
ipcMain.on('listFiles', (event, arg) => {
|
||||||
console.log('Listing all files and directories in ' + arg);
|
console.log('Listing all files and directories in ' + arg);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue