Keypress monitor is a ROS package that creates a pynput keyboard listener and publishes keypress status on a topic whenever defined key is pressed.
By default the
space key is reported.
Use rospram server to define any other key. Example to track the play/pause button is given in the launch file.
Warning: the values reported by pynput are keysyms codes raher than key codes and are as such different from the ones reported by xinput/xev. You can use
rosrun keypress_monitor identify_keycode.py to identify the keysyms of the button pressed.