Keyboard Shortcut for a ui_Button in Dashboard

I have a dashboard with a bunch of ui_buttons, basically to switch Tabs.
is there a way to use a keyboard shortcut, for example Alt+1, Alt+2 etc to click
the buttons instead of a mouse click ?

Don't think you can do it directly, however you can use node-red-contrib-keyboard-mouse-triggers (node) - Node-RED and make your own keyboard triggers that will trigger the button or direct the flow behind the button.

Thanks for the direction. But, Unable to install the contrib-node.

gives me below error, unable to make sense of it. something related to iohook.

-----------------------------------------------------------
2022-06-18T09:08:16.237Z Install : node-red-contrib-keyboard-mouse-triggers 0.6.0

2022-06-18T09:07:01.133Z npm.cmd install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict node-red-contrib-keyboard-mouse-triggers@0.6.0
2022-06-18T09:07:08.368Z [err] npm ERR! code 1
2022-06-18T09:07:08.368Z [err] npm ERR!
2022-06-18T09:07:08.368Z [err]  
2022-06-18T09:07:08.368Z [err] path c:\Users\oeeho\.node-red2\node_modules\segfault-handler
2022-06-18T09:07:08.373Z [err] npm ERR! command failed
2022-06-18T09:07:08.374Z [err] npm
2022-06-18T09:07:08.374Z [err]  ERR!
2022-06-18T09:07:08.374Z [err]  command C:\WINDOWS\system32\cmd.exe /d /s /c node-gyp rebuild
2022-06-18T09:07:08.374Z [err] npm 
2022-06-18T09:07:08.374Z [err] ERR! gyp info it worked if it ends with ok
2022-06-18T09:07:08.374Z [err] npm
2022-06-18T09:07:08.374Z [err]  ERR!
2022-06-18T09:07:08.374Z [err]  gyp info using node-gyp@8.4.1
2022-06-18T09:07:08.374Z [err] npm ERR!
2022-06-18T09:07:08.374Z [err]  gyp info using node@16.14.2 | win32 | x64
2022-06-18T09:07:08.374Z [err] npm ERR!
2022-06-18T09:07:08.374Z [err]  gyp ERR! find Python 
2022-06-18T09:07:08.374Z [err] npm 
2022-06-18T09:07:08.374Z [err] ERR! gyp ERR! find Python Python is not set from command line or npm configuration
2022-06-18T09:07:08.374Z [err] npm 
2022-06-18T09:07:08.375Z [err] ERR! gyp ERR! find Python Python is not set from environment variable PYTHON
2022-06-18T09:07:08.375Z [err] npm ERR!
2022-06-18T09:07:08.375Z [err]  gyp ERR! find Python checking if "python3" can be used
2022-06-18T09:07:08.375Z [err] npm
2022-06-18T09:07:08.375Z [err]  ERR!
2022-06-18T09:07:08.375Z [err]  gyp ERR! find Python - "python3" is not in PATH or produced an error
2022-06-18T09:07:08.375Z [err] npm 
2022-06-18T09:07:08.375Z [err] ERR! gyp ERR! find Python checking if "python" can be used
2022-06-18T09:07:08.375Z [err] npm
2022-06-18T09:07:08.375Z [err]  ERR!
2022-06-18T09:07:08.375Z [err]  gyp ERR! find Python - "python" is not in PATH or produced an error
2022-06-18T09:07:08.375Z [err] npm ERR!
2022-06-18T09:07:08.375Z [err]  gyp ERR! find Python checking if Python is C:\WINDOWS\system32\config\systemprofile\AppData\Local\Programs\Python\Python39\python.exe
2022-06-18T09:07:08.375Z [err] npm ERR!
2022-06-18T09:07:08.375Z [err]  gyp ERR! find Python - "C:\WINDOWS\system32\config\systemprofile\AppData\Local\Programs\Python\Python39\python.exe" could not be run
2022-06-18T09:07:08.375Z [err] npm 
2022-06-18T09:07:08.376Z [err] ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python39\python.exe
2022-06-18T09:07:08.376Z [err] npm ERR! gyp ERR! find Python - "C:\Program Files\Python39\python.exe" could not be run
2022-06-18T09:07:08.376Z [err] npm ERR! gyp ERR! find Python checking if Python is C:\WINDOWS\system32\config\systemprofile\AppData\Local\Programs\Python\Python39-32\python.exe
2022-06-18T09:07:08.376Z [err] npm ERR! gyp ERR! find Python - "C:\WINDOWS\system32\config\systemprofile\AppData\Local\Programs\Python\Python39-32\python.exe" could not be run
2022-06-18T09:07:08.376Z [err] npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python39-32\python.exe
2022-06-18T09:07:08.376Z [err] npm ERR! gyp ERR! find Python - "C:\Program Files\Python39-32\python.exe" could not be run
2022-06-18T09:07:08.376Z [err] npm ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python39-32\python.exe
2022-06-18T09:07:08.376Z [err] npm ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python39-32\python.exe" could not be run
2022-06-18T09:07:08.376Z [err] npm ERR! gyp ERR! find Python checking if Python is C:\WINDOWS\system32\config\systemprofile\AppData\Local\Programs\Python\Python38\python.exe
2022-06-18T09:07:08.376Z [err] npm ERR! gyp ERR! find Python - "C:\WINDOWS\system32\config\systemprofile\AppData\Local\Programs\Python\Python38\python.exe" could not be run
2022-06-18T09:07:08.377Z [err] npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python38\python.exe
2022-06-18T09:07:08.377Z [err] npm ERR! gyp ERR! find Python - "C:\Program Files\Python38\python.exe" could not be run
2022-06-18T09:07:08.377Z [err] npm ERR! gyp ERR! find Python checking if Python is C:\WINDOWS\system32\config\systemprofile\AppData\Local\Programs\Python\Python38-32\python.exe
2022-06-18T09:07:08.377Z [err] npm ERR! gyp ERR! find Python - "C:\WINDOWS\system32\config\systemprofile\AppData\Local\Programs\Python\Python38-32\python.exe" could not be run
2022-06-18T09:07:08.377Z [err] npm
2022-06-18T09:07:08.377Z [err]  ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python38-32\python.exe
2022-06-18T09:07:08.377Z [err] npm ERR! gyp ERR! find Python - "C:\Program Files\Python38-32\python.exe" could not be run
2022-06-18T09:07:08.377Z [err] npm 
2022-06-18T09:07:08.377Z [err] ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python38-32\python.exe
2022-06-18T09:07:08.377Z [err] npm ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python38-32\python.exe" could not be run
2022-06-18T09:07:08.377Z [err] npm
2022-06-18T09:07:08.377Z [err]  ERR!
2022-06-18T09:07:08.377Z [err]  gyp ERR! find Python checking if Python is C:\WINDOWS\system32\config\systemprofile\AppData\Local\Programs\Python\Python37\python.exe
2022-06-18T09:07:08.377Z [err] npm 
2022-06-18T09:07:08.377Z [err] ERR! gyp ERR! find Python - "C:\WINDOWS\system32\config\systemprofile\AppData\Local\Programs\Python\Python37\python.exe" could not be run
2022-06-18T09:07:08.377Z [err] npm
2022-06-18T09:07:08.377Z [err]  ERR!
2022-06-18T09:07:08.377Z [err]  gyp ERR! find Python checking if Python is C:\Program Files\Python37\python.exe
2022-06-18T09:07:08.377Z [err] npm
2022-06-18T09:07:08.377Z [err]  ERR! gyp ERR! find Python - "C:\Program Files\Python37\python.exe" could not be run
2022-06-18T09:07:08.377Z [err] npm ERR!
2022-06-18T09:07:08.377Z [err]  gyp ERR! find Python checking if Python is C:\WINDOWS\system32\config\systemprofile\AppData\Local\Programs\Python\Python37-32\python.exe
2022-06-18T09:07:08.377Z [err] npm
2022-06-18T09:07:08.377Z [err]  ERR!
2022-06-18T09:07:08.378Z [err]  gyp ERR! find Python - "C:\WINDOWS\system32\config\systemprofile\AppData\Local\Programs\Python\Python37-32\python.exe" could not be run
2022-06-18T09:07:08.378Z [err] npm
2022-06-18T09:07:08.378Z [err]  ERR!
2022-06-18T09:07:08.378Z [err]  gyp ERR! find Python checking if Python is C:\Program Files\Python37-32\python.exe
2022-06-18T09:07:08.378Z [err] npm 
2022-06-18T09:07:08.378Z [err] ERR! gyp ERR! find Python - "C:\Program Files\Python37-32\python.exe" could not be run
2022-06-18T09:07:08.378Z [err] npm
2022-06-18T09:07:08.378Z [err]  ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python37-32\python.exe
2022-06-18T09:07:08.378Z [err] npm ERR!
2022-06-18T09:07:08.378Z [err]  gyp ERR! find Python - "C:\Program Files (x86)\Python37-32\python.exe" could not be run
2022-06-18T09:07:08.378Z [err] npm
2022-06-18T09:07:08.378Z [err]  ERR!
2022-06-18T09:07:08.378Z [err]  gyp ERR! find Python checking if Python is C:\WINDOWS\system32\config\systemprofile\AppData\Local\Programs\Python\Python36\python.exe
2022-06-18T09:07:08.378Z [err] npm ERR!
2022-06-18T09:07:08.378Z [err]  gyp ERR! find Python - "C:\WINDOWS\system32\config\systemprofile\AppData\Local\Programs\Python\Python36\python.exe" could not be run
2022-06-18T09:07:08.378Z [err] npm ERR!
2022-06-18T09:07:08.378Z [err]  gyp ERR! find Python checking if Python is C:\Program Files\Python36\python.exe
2022-06-18T09:07:08.378Z [err] npm
2022-06-18T09:07:08.378Z [err]  ERR!
2022-06-18T09:07:08.378Z [err]  gyp ERR! find Python - "C:\Program Files\Python36\python.exe" could not be run
2022-06-18T09:07:08.378Z [err] npm 
2022-06-18T09:07:08.378Z [err] ERR! gyp ERR! find Python checking if Python is C:\WINDOWS\system32\config\systemprofile\AppData\Local\Programs\Python\Python36-32\python.exe
2022-06-18T09:07:08.378Z [err] npm 
2022-06-18T09:07:08.379Z [err] ERR! gyp ERR! find Python - "C:\WINDOWS\system32\config\systemprofile\AppData\Local\Programs\Python\Python36-32\python.exe" could not be run
2022-06-18T09:07:08.379Z [err] npm 
2022-06-18T09:07:08.379Z [err] ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python36-32\python.exe
2022-06-18T09:07:08.379Z [err] npm
2022-06-18T09:07:08.379Z [err]  ERR! gyp ERR! find Python - "C:\Program Files\Python36-32\python.exe" could not be run
2022-06-18T09:07:08.379Z [err] npm ERR!
2022-06-18T09:07:08.379Z [err]  gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python36-32\python.exe
2022-06-18T09:07:08.379Z [err] npm 
2022-06-18T09:07:08.379Z [err] ERR!
2022-06-18T09:07:08.379Z [err]  gyp ERR! find Python - "C:\Program Files (x86)\Python36-32\python.exe" could not be run
2022-06-18T09:07:08.379Z [err] npm ERR!
2022-06-18T09:07:08.379Z [err]  gyp ERR! find Python checking if the py launcher can be used to find Python 3
2022-06-18T09:07:08.379Z [err] npm
2022-06-18T09:07:08.379Z [err]  ERR!
2022-06-18T09:07:08.379Z [err]  gyp ERR! find Python - "py.exe" is not in PATH or produced an error
2022-06-18T09:07:08.379Z [err] npm 
2022-06-18T09:07:08.379Z [err] ERR! gyp ERR! find Python 
2022-06-18T09:07:08.379Z [err] npm ERR!
2022-06-18T09:07:08.379Z [err]  gyp ERR! find Python **********************************************************
2022-06-18T09:07:08.379Z [err] npm 
2022-06-18T09:07:08.379Z [err] ERR! gyp ERR! find Python You need to install the latest version of Python.
2022-06-18T09:07:08.380Z [err] npm 
2022-06-18T09:07:08.380Z [err] ERR! gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
2022-06-18T09:07:08.380Z [err] npm ERR!
2022-06-18T09:07:08.380Z [err]  gyp ERR! find Python you can try one of the following options:
2022-06-18T09:07:08.380Z [err] npm 
2022-06-18T09:07:08.380Z [err] ERR!
2022-06-18T09:07:08.380Z [err]  gyp ERR! find Python - Use the switch --python="C:\Path\To\python.exe"
2022-06-18T09:07:08.380Z [err] npm 
2022-06-18T09:07:08.380Z [err] ERR! gyp ERR! find Python   (accepted by both node-gyp and npm)
2022-06-18T09:07:08.380Z [err] npm ERR!
2022-06-18T09:07:08.380Z [err]  gyp ERR! find Python - Set the environment variable PYTHON
2022-06-18T09:07:08.380Z [err] npm 
2022-06-18T09:07:08.380Z [err] ERR! gyp ERR! find Python - Set the npm configuration variable python:
2022-06-18T09:07:08.380Z [err] npm
2022-06-18T09:07:08.380Z [err]  ERR! gyp ERR! find Python   npm config set python "C:\Path\To\python.exe"
2022-06-18T09:07:08.380Z [err] npm
2022-06-18T09:07:08.380Z [err]  ERR! gyp ERR! find Python For more information consult the documentation at:
2022-06-18T09:07:08.380Z [err] npm
2022-06-18T09:07:08.380Z [err]  ERR! gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
2022-06-18T09:07:08.380Z [err] npm 
2022-06-18T09:07:08.380Z [err] ERR! gyp ERR! find Python **********************************************************
2022-06-18T09:07:08.380Z [err] npm ERR!
2022-06-18T09:07:08.380Z [err]  gyp ERR! find Python 
2022-06-18T09:07:08.380Z [err] npm ERR!
2022-06-18T09:07:08.380Z [err]  gyp ERR! configure error 
2022-06-18T09:07:08.380Z [err] npm ERR!
2022-06-18T09:07:08.381Z [err]  gyp ERR! stack Error: Could not find any Python installation to use
2022-06-18T09:07:08.381Z [err] npm ERR!
2022-06-18T09:07:08.381Z [err]  gyp ERR! stack     at PythonFinder.fail (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:330:47)
2022-06-18T09:07:08.381Z [err] npm ERR!
2022-06-18T09:07:08.381Z [err]  gyp ERR! stack     at PythonFinder.runChecks (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:159:21)
2022-06-18T09:07:08.381Z [err] npm ERR!
2022-06-18T09:07:08.381Z [err]  gyp ERR! stack     at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:228:18)
2022-06-18T09:07:08.381Z [err] npm ERR!
2022-06-18T09:07:08.381Z [err]  gyp ERR! stack     at PythonFinder.execFileCallback (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:294:16)
2022-06-18T09:07:08.381Z [err] npm ERR!
2022-06-18T09:07:08.381Z [err]  gyp ERR! stack     at exithandler (node:child_process:406:5)
2022-06-18T09:07:08.381Z [err] npm ERR!
2022-06-18T09:07:08.381Z [err]  gyp ERR! stack     at ChildProcess.errorhandler (node:child_process:418:5)
2022-06-18T09:07:08.381Z [err] npm ERR!
2022-06-18T09:07:08.381Z [err]  gyp ERR! stack     at ChildProcess.emit (node:events:526:28)
2022-06-18T09:07:08.381Z [err] npm ERR!
2022-06-18T09:07:08.381Z [err]  gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:289:12)
2022-06-18T09:07:08.381Z [err] npm ERR!
2022-06-18T09:07:08.381Z [err]  gyp ERR! stack     at onErrorNT (node:internal/child_process:478:16)
2022-06-18T09:07:08.381Z [err] npm ERR!
2022-06-18T09:07:08.381Z [err]  gyp ERR! stack     at processTicksAndRejections (node:internal/process/task_queues:83:21)
2022-06-18T09:07:08.381Z [err] npm ERR! gyp ERR! System Windows_NT 10.0.19044
2022-06-18T09:07:08.381Z [err] npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
2022-06-18T09:07:08.381Z [err] npm
2022-06-18T09:07:08.381Z [err]  ERR! gyp ERR! cwd c:\Users\oeeho\.node-red2\node_modules\segfault-handler
2022-06-18T09:07:08.381Z [err] npm 
2022-06-18T09:07:08.381Z [err] ERR! gyp ERR! node -v v16.14.2
2022-06-18T09:07:08.381Z [err] npm 
2022-06-18T09:07:08.381Z [err] ERR! gyp ERR! node-gyp -v v8.4.1
2022-06-18T09:07:08.381Z [err] npm 
2022-06-18T09:07:08.382Z [err] ERR! gyp ERR! not ok
2022-06-18T09:07:08.385Z [err] 
2022-06-18T09:07:08.385Z [err] npm ERR! A complete log of this run can be found in:
2022-06-18T09:07:08.385Z [err] npm ERR!     C:\WINDOWS\system32\config\systemprofile\AppData\Local\npm-cache\_logs\2022-06-18T09_07_02_948Z-debug-0.log
2022-06-18T09:07:08.410Z rc=1

Iohook ? They all say that it can’t find python installed anywhere.

Strange!. i tried 2-3 times to install keyboard-mouse triggers contrib node, looks like each time it gives a different error? i was sure i read something about io-hook. did not read the error log before copy pasting

-----------------------------------------------------------
2022-06-18T09:26:58.825Z Install : node-red-contrib-keyboard-mouse-triggers 0.6.0

2022-06-18T09:26:58.833Z npm.cmd install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict node-red-contrib-keyboard-mouse-triggers@0.6.0
2022-06-18T09:27:04.016Z [err] npm
2022-06-18T09:27:04.016Z [err]  
2022-06-18T09:27:04.016Z [err] ERR! 
2022-06-18T09:27:04.016Z [err] code 1
2022-06-18T09:27:04.016Z [err] npm
2022-06-18T09:27:04.016Z [err]  ERR!
2022-06-18T09:27:04.016Z [err]  
2022-06-18T09:27:04.016Z [err] path c:\Users\oeeho\.node-red2\node_modules\iohook
2022-06-18T09:27:04.021Z [err] npm ERR! command failed
2022-06-18T09:27:04.021Z [err] npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node install.js
2022-06-18T09:27:04.021Z [err] npm ERR! Downloading prebuild for platform: iohook-v0.2.0-node-v93-win32-x64
2022-06-18T09:27:04.021Z [err] npm ERR! Prebuild for current platform (iohook-v0.2.0-node-v93-win32-x64) not found!
2022-06-18T09:27:04.021Z [err] npm ERR! Try to compile for your platform:
2022-06-18T09:27:04.021Z [err] npm
2022-06-18T09:27:04.021Z [err]  ERR! # cd node_modules/iohook;
2022-06-18T09:27:04.021Z [err] npm ERR! # npm run compile
2022-06-18T09:27:04.021Z [err] npm
2022-06-18T09:27:04.021Z [err]  ERR!
2022-06-18T09:27:04.021Z [err]  
2022-06-18T09:27:04.021Z [err] npm 
2022-06-18T09:27:04.021Z [err] ERR! 
2022-06-18T09:27:04.021Z [err] npm
2022-06-18T09:27:04.021Z [err]  ERR! c:\Users\oeeho\.node-red2\node_modules\iohook\install.js:14
2022-06-18T09:27:04.021Z [err] npm ERR!
2022-06-18T09:27:04.021Z [err]    throw err;
2022-06-18T09:27:04.021Z [err] npm ERR!
2022-06-18T09:27:04.021Z [err]    ^
2022-06-18T09:27:04.021Z [err] npm 
2022-06-18T09:27:04.021Z [err] ERR! Prebuild for current platform (iohook-v0.2.0-node-v93-win32-x64) not found!
2022-06-18T09:27:04.021Z [err] npm
2022-06-18T09:27:04.021Z [err]  ERR! (Use `node --trace-uncaught ...` to show where the exception was thrown)
2022-06-18T09:27:04.025Z [err] 
2022-06-18T09:27:04.025Z [err] npm ERR! A complete log of this run can be found in:
2022-06-18T09:27:04.025Z [err] npm ERR!     C:\WINDOWS\system32\config\systemprofile\AppData\Local\npm-cache\_logs\2022-06-18T09_27_00_655Z-debug-0.log
2022-06-18T09:27:04.049Z rc=1

You probably need windows build tools installed. When you install nodejs v14 or above, there is an option to install necessary tools. You should have checked that.

https://images.app.goo.gl/cTxRPzsX6wAMqMMYA

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.