Posted on Leave a comment

Hacking your Rasptendo: Configuring Rasptendo RESET button to Exit Emulator with Retrogame

The Rasptendo case is inspired by the SNES Classic including the retro looking POWER and RESET buttons.

In the SNES classic, the reset button takes you to the homepage, which is quite different in our case (pun intended). The Rasptendo RESET button’s default function is to issue a SOFT or HARD reset. We did this since going back to the homepage of RetroPie is fairly simple if you have the controller. Just press the Select + Start buttons simultaneously and it takes you there.

But if you want to have that nostalgic feeling of standing up and pressing the Reset button to change games, or you just want to impress your friends that your set up almost works like the real thing, we got you. The general idea of how this works is this, assign a GPIO to a key event using a virtual keyboard mapped into your GPIO then taking that key event as a signal for your RetroPie to exit emulator. Sounds complicated? Don’t worry, we’re taking you there step by step.

Step 1 – Set up Adafruit Retrogame

Making your GPIO a virtual keyboard is not an easy task. Luckily for us mere peasants, our lords and ladies from Adafruit created Retrogame which does all of the heavy lifting for us (about 99%?). To download this, type in your terminal,

sudo curl -f -s -o /usr/local/bin/retrogame

then make retrogame executable

sudo chmod 755 /usr/local/bin/retrogame

Step 2 – Configure the RESET button as ESC key

Adafruit Retrogame has to use a configuration file to know what GPIO pins are mapped into the virtual keyboard.

In our case, we are going to use Pins 16 (GPIO23) and 14 (GND) since they are adjacent to each other.

Connect the RESET jumper wires in Pins 16 and 14.

Create the file /boot/retrogame.cfg and map the GPIO.

sudo nano /boot/retrogame.cfg

In the editor, enter the following

ESC 23

This means we are mapping GPIO23 (Pin 16) to ESC of the virtual keyboard.

Step 3 – Add a udev rule

The udev is Linux’s device management system that allows you to identify devices based on their properties. Creating a custom udev rule allows RetroPie to see key events generated by Retrogame. To do this, type

sudo nano /etc/udev/rules.d/10-retrogame.rules

In the editor, copy this line:

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

Step 4 – Start Retrogame on every boot

Open rc.local in your terminal editor,

sudo nano /etc/rc.local

Before the line exit 0, insert the following:

sudo /usr/local/bin/retrogame &

Step 5 – Edit RetroArch configuration file


sudo nano /opt/retropie/configs/all/retroarch.cfg

Look for the line,

input_exit_emulator = "escape"

If another button is assigned to it, change it back to "escape", otherwise leave it be.
Look again for the line,

input_enable_hotkey = "nul"

Change the "nul" value into "escape" and that’s it! Reboot your pi and the RESET button as exit emulator button should work.

Posted on 31 Comments


You now have your new Rasptendo Case. Now it’s time for you to assemble and configure it along with your Raspberry Pi 3 to transform it into the Rasptendo retro gaming console.

The Rasptendo Package Box comes with

  • Rasptendo Case
  • 2 male to female USB extender
  • POWER and RESET Button PCB Board
  • 6 labeled female to female jumper wires
  • 2 male GPIO header
  • Installation guide
  • heat sink

The POWER button issues a safe shutdown command to your Raspberry Pi to prevent damage to your SD card. For the RESET button, you can have two (2) options – one for the soft reboot, and one for the hard reset.

Option 1 for the RESET button issues a soft reboot, which is the safe way (for your SD Card) of rebooting. It’s the same as issuing a sudo reboot in the terminal. It’s especially useful when you transfer ROMs via WiFi and you have to reboot for the RetroPie to discover the newly transferred games. The minor downside to this option is that if your Raspberry Pi hangs (which happens rarely), the button won’t work. That is why we have the second option – which is the hardware reset. It’s useful when your Raspberry Pi hangs a lot – but if it does, then that game is probably not intended to be played in your Raspberry Pi. But we’re giving you the option by the way. You have to keep in mind that Option 2 is only a slightly better version of unplugging and plugging the power source to your pi, which means it’s still a little risky for your SD card.

Step 1 (Skip when opting to Option 1)

  1. Solder the 2 male GPIO header to the P6 headers (labeled RUN) on your Raspberry Pi 3 board.

Step 2

  1. Insert the 2 male to female USB extender to your Raspberry Pi 3. Mount the other end of the extender to the USB slot in the case. Attach the heat sink to the Pi’s CPU.
  2. Without the Micro SD card inserted, screw your Raspberry Pi 3 at the 3 screw points at the bottom of Rasptendo Case (see illustration below)

Step 3

  1. Connect the other end of POWER SW jumper wires to the pins in the PCB labeled POWER. Connect the other ends at Pins 5 (GPIO3) and 6 (GND).
  2. Connect the RESET SW jumper wires to the pins in the PCB labeled RESET.
    Option 1. (NO SOLDER) Connect the other ends to Pins 13 (GPIO27) and 14 (GND).
    Option 2. Connect the other ends to the P6 headers (the ones you soldered labeled RUN)
  3. Connect the POWER LED+ jumper wire in the PCB labeled LED+. Connect the other end in Pin 8 (GPIO14).
  4. Connect the POWER LED- jumper wire in the PCB labeled LED-. Connect the other end in Pin 9 (GND).
  5. Screw the top component of the Rasptendo Case to its base.

Step 4

  1. Insert your Micro SD Card in your laptop, then download the image of RetroPie in Make sure to download the Raspberry Pi 2/3 version since you are going to install it on your Raspberry Pi 3.
  2. After downloading the .gz file, extract the file using your favorite extraction tool. Remember the directory where you extracted the .img file.
  3. Download the Etcher software and install. Click Select image then navigate to the extracted .img file. Click Select drive then choose the SD card. Click Flash! then wait for the process to finish.

Step 5

Now that you have assembled your Rasptendo game console, it’s time to install and configure some files for the POWER and RESET buttons to work. Fortunately, you can do this via online with a one line install using wget and bash in the Terminal.
1. Connect your Rasptendo console to a monitor and a keyboard before powering your Raspbery Pi.
2. Connect your Rasptendo to the internet. You may access the internet via LAN or via WiFi. (To configure your WiFi via Terminal follow this tutorial.)
3. Access the Terminal of your RetroPie by pressing F4 upon boot up.

In the Terminal, type the following command:

wget -O - "" | sudo bash

This will run a command that will automatically configure your Raspberry Pi 3 to access the Rasptendo Console POWER button. Your Raspberry Pi will automatically reboot in order for the changes to take place.

Step 6

After your Raspberry Pi has rebooted, test the Power button by holding it for a second. The LED will start blinking followed by your Raspberry Pi shutting down. You can turn on your pi by pressing the Power button again.

Raspberry Pi State Action Function
ON long press (>= 1 s) shutdown
ON short press (<1 s) nothing
SLEEP short/long press wakes Pi
Raspberry Pi State Action Function
Option 1 Option 2
ON short/long press soft reboot hard reboot
SLEEP short/long press nothing wakes Pi

If you encountered problems installing or you want to install manually, refer to a more detailed instruction from our GitHub page.