I am trying to write a key listener for a headless Raspberry Pi Zero that I am connected to via SSH; the RPi is set up to imitate an HID keyboard, and I want to pause / resume a macro from the RPi to my PC by pressing certain keys, hence the key listener.

I understand that pynput does not work with a headless set-up due to requiring a display. I found another Python module called keyboard that should work, and I followed the instructions in this post, but my program is still unable to detect keypresses.

Any idea how to fix this?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.