Skip to content

Commit

Permalink
+ Fix cross compilation for linux x64
Browse files Browse the repository at this point in the history
+ Update typings
+ Cleanup repository
+ Fix stop() on shortcut registered
  • Loading branch information
wilix-lead committed Feb 18, 2018
1 parent 44c5935 commit 9b1b134
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ let shId = ioHook.registerShortcut([ALT, F7], (keys) => {
ioHook.unregisterShortcut(shId);
})

console.log('Hook started. Try type something or move mouse');
console.log('Hook started. Try type something or move mouse');
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
const os = require('os');
const EventEmitter = require('events');
const path = require('path');

Expand Down Expand Up @@ -116,7 +115,7 @@ class IOHook extends EventEmitter {
* @param {Boolean} mode
*/
setDebug(mode) {
NodeHookAddon.debugEnable(mode ? true : false);
NodeHookAddon.debugEnable(mode);
}

/**
Expand Down Expand Up @@ -151,6 +150,9 @@ class IOHook extends EventEmitter {
* @private
*/
_handleShortcut(event) {
if (this.active === false) {
return;
}
if (event.type === 'keydown') {
this.shortcuts.forEach(shortcut => {
if (shortcut[event.keycode] !== undefined) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iohook",
"version": "0.1.12",
"version": "0.1.13",
"description": "Node.js global keyboard and mouse hook",
"main": "index.js",
"types": "index.d.ts",
Expand Down

0 comments on commit 9b1b134

Please sign in to comment.