Ask Your Question
0

Subscribe to actions on keyboard (press key)

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

Rick gravatar image

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

Hi,
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,
Rick

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

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

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

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: https://answers.ros.org/question/6349...

edit flag offensive delete link more

Comments

Ok, thank you for your answer.

Rick gravatar imageRick ( 2018-07-03 05:52:51 -0600 )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

Stats

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

Seen: 1,494 times

Last updated: Jul 02 '18