Page 1 of 1

Emulationstation dual controller setup?

Posted: Tue Mar 11, 2014 7:48 pm
by geneworld
Hey guys I have been using RetroPie on my main OS build and have been loving it. I have been learning how to change a lot of things but there is one thing I have been having problems with.

I have two different SNES controllers, and PS2 controller as well a keyboard at any time hooked up to my Pi. It seems I can only use one of those in emulationstation. When I get into a game I am able to use different types but player one is stuck with only the one registered in emulationstation.

I know how to map the controllers, is there a way to configure the emulationstation config file es_inputs.cfg (I think is the file) so that they all work no matter which one is plugged in?

In es_inputs.cfg I see how it changes when I set up a different controller, is there a way I can just set up that file four times and then combine all the contoller inputs into one file? I've tried this in the past with a keyboard and controller but I wasn't able to get it to work and haven't revisited the idea.

Sorry in advance if this sounds a little confusing I am going by memory since I don't have my Pi in front of me at the time.

Thanks! :mrgreen:

Re: Emulationstation dual controller setup?

Posted: Tue Mar 11, 2014 9:44 pm
by Aloshi
You were on the right track!

1. First, delete or move your current ~/.emulationstation/es_input.cfg file.
2. Plug in one device, start EmulationStation and configure the device. After it's done (make sure it gets to the "game select" screen), press F4 to close ES.
3. Rename the es_input.cfg file to something else, preferrably named after the device - e.g. "es_input_kb.cfg" or "es_input_snes.cfg".
4. Repeat steps 2 and 3 for every device you wish to use.
5. Create a blank es_input.cfg file and open it up in a text editor.
6. Merge your various es_input_*.cfg files into the new es_input.cfg file like so:

Code: Select all

<inputList>
	<inputConfig type="keyboard">
		<input name="a" type="key" id="13" value="1" />
		<input name="b" type="key" id="27" value="1" />
		<input name="down" type="key" id="1073741905" value="1" />
		...etc...
	</inputConfig>

	<inputConfig type="joystick" deviceName="Controller (XBOX 360 For Windows)">
		...etc...
	</inputConfig>

	...repeat as necessary...
</inputList>
Notice every <inputConfig> block must be inside of the <inputList> block.

7. Save the file. Celebrate.

ES should now automatically load the proper config whenever its associated device is plugged in, even if you swap controllers while ES is open.

Re: Emulationstation dual controller setup?

Posted: Wed Mar 12, 2014 11:14 am
by geneworld
Aloshi wrote:
Notice every <inputConfig> block must be inside of the <inputList> block.
Ahhh alright that makes sense! I wasn't including the <inputList> block...I started with everything after. I'll give that a go!

Thanks a lot Aloshi! I love your work on this. :mrgreen:

Re: Emulationstation dual controller setup?

Posted: Thu Mar 20, 2014 4:28 pm
by nfsse2
I am having trouble getting usb arcade stick to work in emulation station
I put this in command line
cd RetroPie/emulators/RetroArch/installdir/bin
then hit enter
then type ./retroarch-joyconfig
then hit enter
then when I do this
~/RetroPIe/configs/all/retroarch.cfg
I get permission denied

Re: Emulationstation dual controller setup?

Posted: Thu Mar 20, 2014 5:43 pm
by Jessie
nfsse2 wrote:I am having trouble getting usb arcade stick to work in emulation station
I put this in command line
cd RetroPie/emulators/RetroArch/installdir/bin
then hit enter
then type ./retroarch-joyconfig
then hit enter
then when I do this
~/RetroPIe/configs/all/retroarch.cfg
I get permission denied
Anytime you get permission denied try adding "sudo" in front of the command it will make the command run as su.

Re: Emulationstation dual controller setup?

Posted: Fri Jun 12, 2015 11:47 am
by brucem
On a similar note, is it possible to have 2 different keys on a keyboard perform the same function? I have an arcade controller and ir remote that both show up as a keyboard, and one of them sends left control as button a and the other sends enter. So I need both lctrl and enter to act as button a. Is this possible? Thanks!

Re: Emulationstation dual controller setup?

Posted: Thu Jul 16, 2015 1:47 pm
by geauxwave
Aloshi wrote:You were on the right track!

1. First, delete or move your current ~/.emulationstation/es_input.cfg file.
2. Plug in one device, start EmulationStation and configure the device. After it's done (make sure it gets to the "game select" screen), press F4 to close ES.
3. Rename the es_input.cfg file to something else, preferrably named after the device - e.g. "es_input_kb.cfg" or "es_input_snes.cfg".
4. Repeat steps 2 and 3 for every device you wish to use.
5. Create a blank es_input.cfg file and open it up in a text editor.
6. Merge your various es_input_*.cfg files into the new es_input.cfg file like so:

Code: Select all

<inputList>
	<inputConfig type="keyboard">
		<input name="a" type="key" id="13" value="1" />
		<input name="b" type="key" id="27" value="1" />
		<input name="down" type="key" id="1073741905" value="1" />
		...etc...
	</inputConfig>

	<inputConfig type="joystick" deviceName="Controller (XBOX 360 For Windows)">
		...etc...
	</inputConfig>

	...repeat as necessary...
</inputList>
Notice every <inputConfig> block must be inside of the <inputList> block.

7. Save the file. Celebrate.

ES should now automatically load the proper config whenever its associated device is plugged in, even if you swap controllers while ES is open.
This is awesome. Thank you so much. Could this same method be used in the emulators' joystick configs to allow multiple controllers to be used in the same emulator?

My plan is to add ports for SNES, N64, and Genesis (as well as PS3 over bluetooth). I would like to allow for all of the Player 1 ports/controllers to work for all of the emulators' Player 1 (or at least whatever buttons are available), and same for Player 2. This would allow me to switch emulators without having to switch controllers every time. It would also allow--for example--one player to use a SNES controller and the other player use a Genesis controller while playing the NES emulator, etc etc.