Homepage › Forums › RetroPie Project › Controller Configuration in RetroPie › Can Raspbian commands be assigned to buttons in a .map file?
- This topic has 4 replies, 2 voices, and was last updated 8 years, 10 months ago by labelwhore.
-
AuthorPosts
-
02/17/2016 at 15:21 #117305keem85Participant
I’m asking because I use Moonlight stream to stream my PS2 emulator, Steam and Dolphin.. When I exit my apps, the Moonlight keeps streaming, because Moonlight hasn’t received it’s end-command “moonlight quit <IP>”…
So, is it possible for me to alter my controller.map file, and add that command to my “special” button somehow? Or are there any other tips for this?.. Now I have to open up SSH on my mobile and “kill” the moonlight stream every time I exit a game.
02/17/2016 at 15:55 #117307labelwhoreParticipantI’ve got a better idea. If you need this to run every time you quit an emulator, then simply modify the launch commands in your /opt/retropie/configs/{system}/emulators.cfg files.
So in those files you’ll see some lines like kind of this
emulator-name=”/path/to/runcommand.sh command/line/to_start/emulator %ROM%”All you need to do is add this
&& moonlight quit <IP>
between the %ROM% and the last “. so they’ll look something like this:
emulator-name=”/path/to/runcommand.sh command/line/to_start/emulator %ROM% && moonlight quit <IP>”If you don’t actually need that to run every time, it’ll produce an error message when you close the emulator and moonlight was not running. To supress that error messag you could modify the line like this instead:
emulator-name=”/path/to/runcommand.sh command/line/to_start/emulator %ROM% && moonlight quit <IP> 2&>1 >/dev/null”
02/17/2016 at 17:55 #117319keem85ParticipantNice, once again you are very helpful! I think I need to do a backup first.. But I’m curious; Why does it work? I’m curious to the technical part of %ROM% etc.. The whole line there.. What’s it for?
Edit: I cannot find the emulator to use. I’m using Moonlight-embedded, and that does not have that .cfg file
02/17/2016 at 18:30 #117322labelwhoreParticipantIt’s the command line that starts the emulator. Basically, ES is just a nice looking interface that runs things from command line for you.
To break it down the runcommand.sh script does a handful of things, it logs errors and does some cleanup after emulators quit, gives you that little interface to switch emulators and settings, and probably some other things I’m not aware of. The next piece is the actual command line that you would run if you were to start the emulator from command line directly. The part before the equal sign is just the name of the emulator that appears if you hit a button before the emulator were to start.
So what we’re doing is simply adding another command that always runs after you exit the emulator. From the command line you can run multiple commands one after another by stringing them together and separating them by
&&
. The%ROM%
is just a variable that gets swapped out with the path to the rom that’s being started.02/17/2016 at 20:01 #117368labelwhoreParticipantedit: wrong thrad
-
AuthorPosts
- The forum ‘Controller Configuration in RetroPie’ is closed to new topics and replies.