diff --git a/config.json b/config.json index d8a1e16..ccf9407 100644 --- a/config.json +++ b/config.json @@ -5,10 +5,10 @@ }, "watchers": [ { - "device": "/dev/input/event10", + "device": "usb-Razer_Razer_Blade_Stealth-if01-event-kbd", "keys": [ { - "key": "enter", + "key": "key_enter", "type": "keydown", "command": "notify-send", "args": [ @@ -17,7 +17,7 @@ ] }, { - "key": "esc", + "key": "key_esc", "type": "keyup", "command": "notify-send", "args": [ @@ -26,7 +26,7 @@ ] }, { - "key": "space", + "key": "key_space", "type": "keyhold", "delay": 1000, "command": "notify-send", diff --git a/libs/keyfilter.js b/libs/keyfilter.js index 32fd71d..a25569a 100644 --- a/libs/keyfilter.js +++ b/libs/keyfilter.js @@ -1,7 +1,5 @@ const FILTER_START = 'Testing ... (interrupt to exit)'; -const KEY_PREFIX = 'KEY_'; - const ACTION_KEYUP = { id: 0, action: 'keyup' }; const ACTION_KEYDOWN = { id: 1, action: 'keydown' }; const ACTION_KEYHOLD = { id: 2, action: 'keyhold' }; @@ -28,7 +26,7 @@ class Keyfilter { var command = config[index].command; var args = config[index].args; var delay = config[index].delay; - this.actions.set(KEY_PREFIX + config[index].key.toUpperCase(), { type, command, args, delay }); + this.actions.set(config[index].key.toUpperCase(), { type, command, args, delay }); } } filterActive(input) { diff --git a/libs/watcher.js b/libs/watcher.js index 2b592b3..48e7a00 100644 --- a/libs/watcher.js +++ b/libs/watcher.js @@ -23,7 +23,7 @@ class Watcher { return; } logger.debug('starting watcher \'' + this.device + '\'...'); - this.process = spawn("evtest", [this.device]); + this.process = spawn("evtest", [this.device, "|", "grep", "EV_KEY"]); this.attachListeners(); logger.info('watcher \'' + this.device + '\' initialized and capturing configured events'); }