Coin insert hotkeys
I wanted the ability to use the coin insert buttons as a means of controlling the machine’s state without the need for cycling through menus. To do this, I created a Triggerhappy profile that you can download and save to /etc/triggerhappy/triggers.d/
You’ll also want to download and save the following scripts to /usr/local/bin/
:
Then, I disabled the systemd-based loading of Triggerhappy:
(
sudo systemctl stop triggerhappy.{service,socket}
sudo systemctl disable triggerhappy.{service,socket}
)
Since I’d rather have Retropie launch Triggerhappy to simplify user permissions (systemd ran it as the unprivileged nobody user, while as Retropie will run it as the privileged pi user), I added the following line to the top of /opt/retropie/configs/all/autostart.sh
:
/usr/sbin/thd --triggers /etc/triggerhappy/triggers.d/ --deviceglob /dev/input/event* &
Then, to have a clean start, I rebooted the machine with sudo reboot
.
Now when the machine loads up, the coin insert buttons can be held in varying combinations to trigger a function:
Leonardo (Player 3) coin | Michelangelo (Player 1) coin | Donatello (Player 2) coin | Raphael (Player 4) coin | Function |
---|---|---|---|---|
✅ | ✅ | Exit emulator/program | ||
✅ | ✅ | Reboot machine | ||
✅ | ✅ | ✅ | ✅ | Shutdown machine |