vnz-keyboard-hook
v0.1.3
Published
A Node JS module to help you hook keyboard events.
Downloads
3
Readme
Vnz Keyboard Hook
This Module help you to listen for Keyboard Actions natively. It uses a Java Module (JNativeHook) to intercept the keyboard events. That way you don't need node-gyp to rebuild this module.
Install
npm install --save vnz-keyboard-hook
Examples
Examples: All the examples are available at 'examples' folder.
var hook = require('../nkbhook.js');
var onPressed = function (pressed) {
console.log(pressed);
console.log('You pressed the key with code ' + pressed.code);
};
hook.start().onPressed(onPressed);
Response
The response is a JSON format with the following fields:
{
action: ..., //Action of event - PRESSED, RELEASED, TYPED
code: ..., //Key Code
key: ..., //Key Char
name: ..., //Key Name
shift: ..., //If Shift is pressed
alt: ..., //If alt is pressed
ctrl: ..., //If ctrl is pressed
meta: ... //If meta is pressed
}