Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node的iohook库 #57

Open
Wscats opened this issue Oct 16, 2019 · 1 comment
Open

node的iohook库 #57

Wscats opened this issue Oct 16, 2019 · 1 comment

Comments

@Wscats
Copy link
Owner

Wscats commented Oct 16, 2019

监听全局键盘

'use strict';
const ioHook = require('iohook');
ioHook.on('keydown', event => {
  console.log(event); // { type: 'mousemove', x: 700, y: 400 }
});
// Register and start hook
ioHook.start();
// Alternatively, pass true to start in DEBUG mode.
ioHook.start(true);

监听全局鼠标

'use strict';
const ioHook = require('iohook');
ioHook.on('mousemove', event => {
  console.log(event); // { type: 'mousemove', x: 700, y: 400 }
});
// Register and start hook
ioHook.start();
// Alternatively, pass true to start in DEBUG mode.
ioHook.start(true);
@Heathy
Copy link

Heathy commented Nov 13, 2019

使用ioHooK模块来监听onkeydown和onmousemove这两个事件

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants