Contrib Keypress

Good morning all,
The debug node at the exit of my keypress node remains hopelessly empty although I type like a madman on my keyboard.
The newbie that I am has been in the dark for three days: nothing in this forum nor in the google friend.
Anyone have a solution to calm him down?
:slight_smile:

If you are using node-red-contrib-keypress, that node has not been updated in over 4 years. There is an issue of the node causing problems being deployed but no response (yet) from the author

You might want to look for another solution to what you are trying to do.

ThanksThanks for your super quick response.
In fact I am looking to recover keyboard inputs that I sort through a switch node to release exec nodes.

Did you notice that the readme for that node said that it only works when typing into the terminal where you started node-red from?
Also node-red cannot be running as a service, you must have started it using the node-red command directly.
Can you explain a bit more what you are trying to achieve. Remember the user interface for node-red is through a browser normally.

yes I noticed that and also the following wording in the terminal at the launch of node-red: "Raw mode not supported in this terminal" then "started keypress capturing"

Do you know what it means by " If your terminal does not support ttty, you will see keys output in terminal" because I don't. Do you see your keypresses output in the terminal?

  1. no I don't know what tty means; I searched but I got lost en route on this track.
  2. In the terminal that I open to launch node-red my entries are displayed well

I have the impression that keypress is running in another terminal

[{"id":"489eca90.c929d4","type":"exec","z":"1853a33.d48535d","command":"DISPLAY=:0 cvlc -I rc","addpay":true,"append":"--fullscreen --no-video-title-show --loop","useSpawn":"false","timer":"","oldrc":false,"name":"","x":1660,"y":1300,"wires":[[],[],[]]},{"id":"7f69fca9.5e86b4","type":"keypress","z":"1853a33.d48535d","key":"","x":1060,"y":1300,"wires":[["ebc50cf0.7e493","357e8c79.271294"]]},{"id":"ebc50cf0.7e493","type":"switch","z":"1853a33.d48535d","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"a","vt":"str"},{"t":"eq","v":"b","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1250,"y":1300,"wires":[["80b2949c.3a6918"],["af1a15a6.e10928"]]},{"id":"80b2949c.3a6918","type":"change","z":"1853a33.d48535d","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"http://listen.radioking.com/radio/132073/stream/171985","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1420,"y":1260,"wires":[["489eca90.c929d4"]]},{"id":"af1a15a6.e10928","type":"change","z":"1853a33.d48535d","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"rtsp://mafreebox.freebox.fr/fbxtv_pub/stream?namespace=1&service=201","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1420,"y":1340,"wires":[["489eca90.c929d4"]]},{"id":"357e8c79.271294","type":"debug","z":"1853a33.d48535d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1270,"y":1200,"wires":[]}]

And indeed - what platform are you trying to run this on ?

Raspberry pi 3b+ with buster

does the built in rpi keyboard node not work ?

Yes, it works, but it sends keydown + keyup, so it is necessary to deduplicate

RBE node can help de-duplicate

Yes thanks
I have the solution to deduplicate but I wanted to make more lean and also understand in which terminal runs node-red.
(I had to put an environment variable in my exec node and I don't quite understand how it all works)

It says ttty not tty.

yes ttty !
thousand excuses !
:slight_smile:

In fact, it seems that I have the same problem with the keypress node as with my wireless keyboard: my entries are not captured by node-red (I do not see them in the debug bar) whereas they are captured in the terminal or in any other program as shown in the attached image (last line of the terminal and top right).
However if I use the usb keyboard, my entries appear well in the debug bar of node-red and trigger my exec nodes.
I did not have this problem in a previous installation but unfortunately I did not keep it.

I still do not understand what "ttty" is and wonder if this problem is not related to the fact that the vlc command in the exec node is preceded by Display =: 0.

In the end, I can manage without the keypress node by associating the Pikeyboard and RBE nodes but this does not make it possible to recover the entries from the wireless keyboard. I was hoping that keypress would, but ... no!
Despair, despair and desperation!
:slight_smile:

Note: I use the version of node-red provided with the raspbian buster package

:slight_smile: