My RPi 2 is outfitted with retropie and I'm trying to make a custom controller. I would be using the GPIO and this input would be converted into a keypress. However, I can't find a way to simulate a keypress. What is the best way to do so?


Adafruit have this pretty well covered with their Retrogame package. They have a 'Retro Gaming With Raspberry Pi' tutorial that walks through the whole process of installing the software and hooking everything up. The tutorial looks a little dated now, so you may have to do some double checking of pin numbers and software version numbers to get everything up and running.

If you decide to use Retrogame, make sure you've acknowledged the caveat on the Github page re: RetroPie 2.0+ compatibility. It won't work without adding the following to /etc/udev/rules.d/10-retrogame.rules first:

SUBSYSTEM=="input", ATTRS{name}=="retrogame", ENV{ID_INPUT_KEYBOARD}="1"

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.