I think this may be impossible, but I'd like to rotate the display by 180 degrees on the fly, triggered by a button connected to the input pins.

I built a cocktail-style MAME cabinet (RetroPie) but not all games have native support for cocktail mode. I'd like to mount a physical button on the tabletop that will immediately flip the screen when you press it.

I imagine writing a little script that will load at system boot which will listen for the button press from one of the input pins, and then flip the screen immediately whenever it gets pressed.

Is that possible?


No the display can only be configured at boot. The exception is Pi4.

The Pi4 does not support the display_hdmi_rotate parameter by default but you can make it operate the same as previous models. See https://raspberrypi.stackexchange.com/a/106375/8697

You could write a script that modifies config.txt and reboots, which I have done in the past.

The Pi4 has a Screen Configuration utility which can change GUI display on the fly. This appears to operate independently of the Console frame buffer.

The Screen Configuration utility is just a graphical front end to xranr which should be scriptable.

| improve this answer | |
  • Well I have a Pi4... what about then? (thanks for your help) – user2744010 Jan 17 at 12:16
  • You should put this information in the Question - also do you run GUI? – Milliways Jan 17 at 21:26
  • @Milliways- Well I have some Pi3s and also a Pi4- I didn't think the difference mattered for this question. Anyway on the Pi4 I installed the GUI (because I had to build my own retropie installation) but it auto-boots into emulationstation. Thanks again for any knowledge- – user2744010 Jan 19 at 21:20

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.