UNPKG

electron-uiohook

Version:

[![](https://img.shields.io/npm/v/electron-uiohook/latest?color=CC3534&label=electron-uiohook&logo=npm&labelColor=212121)](https://www.npmjs.com/package/electron-uiohook)

29 lines 974 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const _1 = require("."); const electron_1 = require("electron"); const keycodeMap = new Map(Object.entries(_1.UiohookKey).map(_ => [_[1], _[0]])); let win; console.log('start app'); function prettyModifier(name, state) { return state ? `[${name}]` : ` ${name} `; } electron_1.app.whenReady().then(() => { win = new electron_1.BrowserWindow({ width: 800, height: 600, webPreferences: { nodeIntegration: true } }); win.loadURL("https://www.baidu.com"); _1.uIOhook.on('clipboardChanged', (text) => { console.log('clipboard changed:', electron_1.clipboard.readText(), ' ', text); }); _1.uIOhook.start(); _1.uIOhook.startListenClipboard(); win.on('close', () => { _1.uIOhook.stop(); _1.uIOhook.stopListenClipboard(); win = null; }); }); //# sourceMappingURL=demo-win.js.map