ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Subscribe to actions on keyboard (press key)

asked 2018-07-02 07:30:06 -0500

Rick gravatar image

updated 2018-07-02 07:36:41 -0500

I want to receive messages in ROS that tell me which key was pressed on a keyboard that is connected with the PC. I found several examples for other input devices and also some of them treated the keyboard but just with the up and down arrows. Could you tell me if there is a way to receive also messages when the other keys were pressed (like a letter)? Are there preinstalled nodes/programmes?

With best regards,

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-07-02 08:11:41 -0500

updated 2018-07-02 11:42:38 -0500

You'll want to write:

  1. a keyboard publisher node that publishes key-presses as strings
  2. a subscriber node that subscribes to the key-presses topic.

(or you could handle it all in one script, but this is a more elegant approach)

Also, see these related answers:

edit flag offensive delete link more


Ok, thank you for your answer.

Rick gravatar image Rick  ( 2018-07-03 05:52:51 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2018-07-02 07:30:06 -0500

Seen: 4,065 times

Last updated: Jul 02 '18