Read the statement by Michael Teeuw here.
Change Pages with NumPad
-
@drkineticpie looks like u might need to use the evdev method, and eventPath
-
this.evdevReader.on("EV_KEY", (data) => { // console.log("key : ", data.code, data.value);
Okay right now I do not understand much but I try :D
Is that the reason why in the logs then no keys are detected ?
And how do I tie this in as you mean?
-
@sdetweil said in Change Pages with NumPad:
so it should be
type 1, code 2, for the numb pad 1 keyFor the reason that I can see so a change easier I have decided to switch the monitor by button on or off the whole now looks like this:
module: 'MMM-KeyBindings', config: { evdev: { enabled: false }, enableKeyboard: true, actions: [ { key: '1', state: 'KEY_LONGPRESSED', mode: 'DEFAULT', notification: 'REMOTE_ACTION', payload: { action: "MONITORTOGGLE" }}] } }
-
@drkineticpie ok. I think u needed
evdev: {enabled:true }
and
keyboardEnabled:falseand probably the dev name and path
-
and probably the dev name and path
I would have to deal with even more with that. Let me know in the course of the day if it worked out
-
Hangs now about an hour here already stuck somehow I do not get it set up
[11.09.2021 14:48.55.780] [ERROR] Whoops! There was an uncaught exception... [11.09.2021 14:48.55.797] [ERROR] Error: Cannot find module 'evdev' Require stack: - /home/pi/MagicMirror/modules/MMM-KeyBindings/node_helper.js - /home/pi/MagicMirror/js/app.js - /home/pi/MagicMirror/js/electron.js - /home/pi/MagicMirror/node_modules/electron/dist/resources/default_app.asar/main.js - at Module._resolveFilename (internal/modules/cjs/loader.js:972:15) at Function.n._resolveFilename (electron/js2c/browser_init.js:249:921) at Function.Module._resolveFilename (/home/pi/MagicMirror/node_modules/module-alias/index.js:49:29) at Module._load (internal/modules/cjs/loader.js:848:27) at Function.f._load (electron/js2c/asar_bundle.js:5:12633) at Module.require (internal/modules/cjs/loader.js:1032:19) at require (internal/modules/cjs/helpers.js:72:18) at Class.startEvdevMonitor (/home/pi/MagicMirror/modules/MMM-KeyBindings/node_helper.js:61:17) at Class.socketNotificationReceived (/home/pi/MagicMirror/modules/MMM-KeyBindings/node_helper.js:99:22) at Socket.<anonymous> (/home/pi/MagicMirror/js/node_helper.js:109:11) { code: 'MODULE_NOT_FOUND', requireStack: [ '/home/pi/MagicMirror/modules/MMM-KeyBindings/node_helper.js', '/home/pi/MagicMirror/js/app.js', '/home/pi/MagicMirror/js/electron.js', '/home/pi/MagicMirror/node_modules/electron/dist/resources/default_app.asar/main.js', undefined ] }
and :
pi@Dashboard:~/MagicMirror/modules/MMM-KeyBindings $ cd ~/MagicMirror/modules/MMM-KeyBindings && npm install --force npm WARN using --force Recommended protections disabled. npm WARN deprecated har-validator@5.1.5: this library is no longer supported npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 npm ERR! code 1 npm ERR! git dep preparation failed npm ERR! command /usr/bin/node /usr/lib/node_modules/npm/bin/npm-cli.js install --force --cache=/home/pi/.npm --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit --include=dev --include=peer --include=optional --no-package-lock-only --no-dry-run npm ERR! npm WARN using --force Recommended protections disabled. npm ERR! npm ERR! code ETIMEDOUT npm ERR! npm ERR! syscall connect npm ERR! npm ERR! errno ETIMEDOUT npm ERR! npm ERR! network request to http://10.19.101.12:4873/tar/-/tar-6.1.0.tgz failed, reason: connect ETIMEDOUT 10.19.101.12:4873 npm ERR! npm ERR! network This is a problem related to network connectivity. npm ERR! npm ERR! network In most cases you are behind a proxy or have bad network settings. npm ERR! npm ERR! network npm ERR! npm ERR! network If you are behind a proxy, please make sure that the npm ERR! npm ERR! network 'proxy' config is set properly. See: 'npm help config' npm ERR! npm ERR! npm ERR! A complete log of this run can be found in: npm ERR! npm ERR! /home/pi/.npm/_logs/2021-09-11T13_39_06_205Z-debug.log npm ERR! A complete log of this run can be found in: npm ERR! /home/pi/.npm/_logs/2021-09-11T13_39_11_986Z-debug.log pi@Dashboard:~/MagicMirror/modules/MMM-KeyBindings $
-
@drkineticpie i see the same. seems module is broken, no updates for 3 years… issues open for the same problems…
-
@sdetweil I have now also decided to do it differently, unfortunately it does not work :D
I have a python script:
import requests import keyboard keyboard.add_hotkey("shift+t", lambda: requests.get('http://127.0.0.1:9000/some/endpoint')) keyboard.wait()
Then magicmirror is started via nohup…
However, the script does not work