After getting my brand new Raspberry Pi 3, I was excited to get straight into Steam Streaming with Moonlight using an Xbox 360 Controller. But, I came across an issue where the button’s on the 360 Controller weren’t mapped correctly. The Y button was X and vice versa. So, I dug in really deep through the interwebs and found the solution. This solution stopped working for me so I had to do some further testing.
I’m still working on getting this 100% right now, so I’ll give you the 90% working solution. This will get everything but the two triggers working.
sudo apt-get install evtest
Once installed launch evtest
You will see a list of event devices. You will need to remember the Xbox controller event number. In my case it was 2. Now, you need to map the controller using moonlight. Where it says FILENAME, choose a name you will remember.
moonlight map -input /dev/input/event3 FILNAME.map
Go through and map the corresponding buttons to the on screen requests. When you get to triggers, you will need to press the left button or right button instead. This means games that use the triggers and buttons will have issues.
To run moonlight using the newly created map
moonlight stream -mapping FILENAME.map
That’s it for the 90% solution. Subscribe to the TechWiz YouTube Channel to get the 100% solution once I figure it out.
This was the non-working solution underneath.
First steps, you will need to open a terminal window in Raspbian or through SSH and enter the following commands: sudo modprobe -r xpad
sudo sh -c “echo ‘blacklist xpad’ >> /etc/modprobe.d/gamepad.conf”
sudo nano /etc/rc.local The last command will open a text editor where you will need to enter the following BEFORE the line that reads ‘exit 0’ xboxdrv –trigger-as-button –wid 0 –led 2 –deadzone 4000 –dpad-as-button –silent & Save the file (Ctrl + X) confirm and exit. Change the directory to the Moonlight directory cd ~/Moonlight In order for Moonlight to understand what each button does, a map file will be required. Roelof Berg has created a working map file so all you need to do now is download it with the following command all as one line. wget https://raw.githubusercontent.com/RoelofBerg/moonlightpisteambox/master/xbox.map And lastly, we need to tell Moonlight to use the map file we just downloaded. moonlight stream -mapping xbox.map That’s it! Now Moonlight should be correctly mapped to use the Xbox 360 Controller through your Raspberry Pi 3 (Or Pi2 or B+). Source for all information presented here was from http://embedded-software-architecture.com/?page_id=140