Pause when controller disconnects
-
I just lost at puyo puyo because my PS3 controller ran out of battery. How frustrating !
On the PS3/4, when the controller runs out of battery, the game automatically pause.
Do you know if there is a retroarch option to emulate this (pause the game if a controller is disconnected) ?
I looked in global and core option but found nothing. -
Hi Guys, I didn't had any answer so maybe I'm the only one that have this issue.
I searched though retroach options without finding anything like "pause when a controller disconnects".
Nevertheless, after finding an UDEV solution for switching to TV when a controller is connected, I just realized that a similar rule when a controller is disconnected could pause the current game.
The problem is I didn't find any way to either :
- send a keystoke to retroarch current process (It doesn't accept standard input through /proc/"pid"/fd/0)
- or command current retroach thrugh CLI
So basically I'm stuck :)
Does anyone has an idea ? Could named pipes work ? (It would require a change in retroarch launch script)The last resort would be to open a feature request on retroarch...
-
Digging up this thread after 6 months and no answer :)
After finding the feature described here https://retropie.org.uk/forum/topic/15283/damn-great-retroarch-feature-i-totally-missed
I enabled the Network Control Interface feature, and just created a new UDEV rule :
ACTION=="remove", SUBSYSTEM=="input", ENV{DEVNAME}=="/dev/input/js*", RUN+="/bin/bash -c '/bin/echo -n MENU_TOGGLE | /bin/nc -u -w1 127.0.0.1 55355'"
And it works : Retroarch menu pops up (and game pause) if a controller disconnects.
I won't loose again because an out of battery DS3 :)My 2 cents.
Edit : note you can also pause the game by replacing MENU_TOGGLE by PAUSE_TOGGLE, but it's the retroach (not the in-game) pause, so you have to use a keyboard or the network command again to resume the game, hence I preferred the menu solution.
-
@sano said in Pause when controller disconnects:
Digging up this thread after 6 months and no answer :)
After finding the feature described here https://retropie.org.uk/forum/topic/15283/damn-great-retroarch-feature-i-totally-missed
I enabled the Network Control Interface feature, and just created a new UDEV rule :
ACTION=="remove", SUBSYSTEM=="input", ENV{DEVNAME}=="/dev/input/js*", RUN+="/bin/bash -c '/bin/echo -n MENU_TOGGLE | /bin/nc -u -w1 127.0.0.1 55355'"
And it works : Retroarch menu pops up (and game pause) if a controller disconnects.
I won't loose again because an out of battery DS3 :)My 2 cents.
Edit : note you can also pause the game by replacing MENU_TOGGLE by PAUSE_TOGGLE, but it's the retroach (not the in-game) pause, so you have to use a keyboard or the network command again to resume the game, hence I preferred the menu solution.
That's really interesting. Does it work with any kind of wireless controllers?
-
@chuck_b said in Pause when controller disconnects:
That's really interesting. Does it work with any kind of wireless controllers?
It should work with any type of controller, the configuration makes it so that when a gamepad is disconnected, the menu is shown in RA.
-
@sano said in Pause when controller disconnects:
ACTION=="remove", SUBSYSTEM=="input", ENV{DEVNAME}=="/dev/input/js*", RUN+="/bin/bash -c '/bin/echo -n MENU_TOGGLE | /bin/nc -u -w1 127.0.0.1 55355'"
where exacly you add this command?
-
@dudumaroja Create a new file called
/etc/udev/rules.d/01-rp-disconnect.rules
and add the text in that file. Reboot and it should take effect. -
this work amazingly well.. this should be included with retropie.
-
@mitu naming that file 01-rp-disconnect.rules is mandatory?
-
@chuck_b No, just the file extension has to be
.rules
, otherwise you can name it any way you want
From https://wiki.debian.org/udev:[...] Files in there are parsed in alpha order, as long as the name ends with ".rules".
-
@mitu I put the extension ".rules", but when i disconnect the controller the game doesn't pause.
I setted network_cmd_enable = "true" on retroarch.cfg -
@chuck_b said in Pause when controller disconnects:
I setted network_cmd_enable = "true" on retroarch.cfg
Which config file ? This should be done in the global (
/opt/retropie/configs/all/retroarch.cfg
) file. Did you restart your system after adding the.rules
file ? What controller are you using ? -
i solved. I forgot to remove the # before network_cmd_enable = "true" :)
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.