I have an arcade which runs RetroArch full screen in the foreground, and KM in the background. The arcade is configured to use only the joysticks and buttons as input. One of said buttons is mapped to a keyboard key.
I use KM to handle various crash / hung states that RetroArch may find itself in. Mostly to prevent players from accessing the underlying system. This works pretty well overall. However, there appears to be one situation that only works ‘sometimes’. Specifically, if the foreground application (RetroArch) hangs. Then sometimes, but not always, the keyboard button that I have mapped to quit (2X tap) or force quit (4X tap) the application, doesn’t appear to be captured by KM. In which case, I have to break out the physical keyboard and mouse in order to kill the app via the OS.
I have confirmed that KM is still running, and correctly captures the input so long as the hung app is not in the foreground. Is there a workaround for such an issue?
Thank you very much for your assistance. I have made the suggested changes, and confirmed that they work when the application isn’t hung. Unfortunately, I will need to wait until the system randomly hangs again in the future to fully confirm the solution. But what you suggested makes perfect sense, so I have no doubts that things will work exactly as planned.
Thanks again, I really appreciate it,
Alan
Edit: It appears that the solution sent to me by bodat54871 wasn’t actually posted here. I will include it below.
When you’ve put in the work to make the cabinet "bulletproof" for players. The issue is likely that RetroArch is "hogging" the input queue while it's frozen, preventing the keypress from ever reaching Keyboard Maestro. To fix this, try switching your KM trigger from a "Hot Key" to a "Device Key" trigger; this listens at a lower hardware level and is much harder for a hung app to block. Also, make sure your macro uses a killall -9 shell script to force the exit, as the standard "Quit" command often waits for a handshake from the frozen app that will never come.