MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    Change Pages with NumPad

    Scheduled Pinned Locked Moved Unsolved Troubleshooting
    22 Posts 3 Posters 4.6k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S Do not disturb
      sdetweil @DrKineticPie
      last edited by

      @drkineticpie so it should be

      type 1, code 2, for the numb pad 1 key

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      DrKineticPieD 1 Reply Last reply Reply Quote 0
      • S Do not disturb
        sdetweil @DrKineticPie
        last edited by

        @drkineticpie looks like u might need to use the evdev method, and eventPath

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        1 Reply Last reply Reply Quote 0
        • DrKineticPieD Offline
          DrKineticPie @sdetweil
          last edited by

          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?

          1 Reply Last reply Reply Quote 0
          • DrKineticPieD Offline
            DrKineticPie @sdetweil
            last edited by

            @sdetweil said in Change Pages with NumPad:

            so it should be
            type 1, code 2, for the numb pad 1 key

            For 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" }}]
                 }
                }
            
            S 1 Reply Last reply Reply Quote 0
            • S Do not disturb
              sdetweil @DrKineticPie
              last edited by

              @drkineticpie ok. I think u needed
              evdev: {enabled:true }
              and
              keyboardEnabled:false

              and probably the dev name and path

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              DrKineticPieD 2 Replies Last reply Reply Quote 0
              • DrKineticPieD Offline
                DrKineticPie @sdetweil
                last edited by

                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

                1 Reply Last reply Reply Quote 0
                • DrKineticPieD Offline
                  DrKineticPie @sdetweil
                  last edited by DrKineticPie

                  @sdetweil

                  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 $ 
                  
                  
                  S 1 Reply Last reply Reply Quote 0
                  • S Do not disturb
                    sdetweil @DrKineticPie
                    last edited by

                    @drkineticpie i see the same. seems module is broken, no updates for 3 years… issues open for the same problems…

                    Sam

                    How to add modules

                    learning how to use browser developers window for css changes

                    DrKineticPieD 1 Reply Last reply Reply Quote 0
                    • DrKineticPieD Offline
                      DrKineticPie @sdetweil
                      last edited by DrKineticPie

                      @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

                      1 Reply Last reply Reply Quote 0
                      • 1
                      • 2
                      • 3
                      • 2 / 3
                      • First post
                        Last post
                      Enjoying MagicMirror? Please consider a donation!
                      MagicMirror created by Michael Teeuw.
                      Forum managed by Sam, technical setup by Karsten.
                      This forum is using NodeBB as its core | Contributors
                      Contact | Privacy Policy