Homepage Forums RetroPie Project Controller Configuration in RetroPie xbox 360 wireless controller works in UI but not in any emulator Reply To: xbox 360 wireless controller works in UI but not in any emulator

#114582
labelwhore
Participant

Ok, so here’s what you need to do for the additional controller configs. I may make several updates to this post, so just be aware of that.

First, copy the attached files to your pi. (Remove the .txt extension first of course.) I placed them in /usr/local/ but they could go anywhere. The two attached to this post are for player 1 and player 2 for atari 800 and vice. One more is coming in the next post which is for mouse emulation.

Next, you need to edit rc.local so that xboxdrv uses the config files.

If you have this line:

xboxdrv -D i 0 --next-controller -i 1 --next-controller -i 2 --next-controller -i 3 --deadzone 4000 --dbus disabled &

change it to this:

xboxdrv -D i 0 --alt-config /usr/local/xboxdrv_player1.cfg --alt-config /usr/local/mouse.cfg --next-controller -i 1 --alt-config /usr/local/xboxdrv_player2.cfg --next-controller -i 2 --next-controller -i 3 --deadzone 4000 --dbus disabled &

if you have this line generated by the xboxdrv install from retropie_setup.sh

"/opt/retropie/supplementary/xboxdrv/bin/xboxdrv" --daemon --detach --wid 0 --led 2 --deadzone 4000 --silent --trigger-as-button ---next-controller --wid 1 --led 3 --deadzone 4000 --silent --trigger-as-button --dbus disabled --detach-kernel-driver

change it to this

"/opt/retropie/supplementary/xboxdrv/bin/xboxdrv" --daemon --detach --wid 0 --led 2 --deadzone 4000 --silent --trigger-as-button --alt-config /usr/local/xboxdrv_player1.cfg --alt-config /usr/local/mouse.cfg --next-controller --wid 1 --led 3 --deadzone 4000 --silent --trigger-as-button --alt-config /usr/local/xboxdrv_player2.cfg --dbus disabled --detach-kernel-driver

or if you are using seperate lines like this:

xboxdrv --trigger-as-button --wid 0 --led 2 --deadzone 4000 --silent &
sleep 1
xboxdrv --trigger-as-button --wid 1 --led 3 --deadzone 4000 --silent &
sleep 1
xboxdrv --trigger-as-button --wid 2 --led 4 --deadzone 4000 --silent &
sleep 1
xboxdrv --trigger-as-button --wid 3 --led 5 --deadzone 4000 --silent &

change them so they look lie this:

 xboxdrv --trigger-as-button --wid 0 --led 2 --alt-config /usr/local/xboxdrv_player1.cfg --alt-config /usr/local/mouse.cfg --deadzone 4000 --silent &
 sleep 1
 xboxdrv --trigger-as-button --wid 1 --led 3  --alt-config /usr/local/xboxdrv_player1.cfg --deadzone 4000 --silent &
 sleep 1
 xboxdrv --trigger-as-button --wid 2 --led 4 --deadzone 4000 --silent &
 sleep 1
xboxdrv --trigger-as-button --wid 3 --led 5 --deadzone 4000 --silent &

The very last step is to make the .cfg files executable.

sudo chmod +x /usr/local/xboxdrv_player1.cfg
sudo chmod +x /usr/local/xboxdrv_player2.cfg
sudo chmod +x /usr/local/mouse.cfg

Reboot.

Now, whenever you hit the xbox button on either controller 1 or 2, it will change the control scheme. For player 1, the controller starts up in normal mode. Hitting the xbox button will change to player1.cfg. Hitting it again will enable mouse emulation. One more time will bring back normal operation. Player 2 cycles between normal operation and player1.cfg. Controllers 3 and 4 are unaffected.

Here’s a little explanation of xboxdrv_player1.cfg. player2 is similar:

Hopefully this looks ok…

Interface    | Mapped to   | Atari 800/5200 |    Commodore   |
-------------------------------------------------------------
Right Analog | Arrow Keys  | Menu Nav       | Menu Nav        
Left Analog  | Mouse       | Movement       |                 
D-Pad        | Joystick    |                | Joystick port 2 
-------------------------------------------------------------
A Button     | Right Ctrl  |                | Fire            
B Button     | Num Pad 0   | Fire           | Fire            
X Button     | Enter       |                | Return          
Y Button     | Space       | Space          | Space           
-------------------------------------------------------------
L1 Button    | F4          | Start Game     |                 
R1 Button    | F7          |                |                 
L2 Button    | PAGEUP      |                |                 
R2 Button    | CAPSLOCK    |                | Start Game      
--------------------------------------------------------------
Start        | F1          | Menu           | Menu            
Back         | Esc         | Esc            | Esc