FORUMS

HTC Delivering Ads Straight to Sense Home

HTC’s 2015 has been a year marked by a desperate search for revenue.The HTC One M9 … more

Galaxy S6 & Edge get €100 Price Cut—New Models Incoming

Samsung has dropped the price of both the Galaxy S6 and S6 Edge by … more

How To Port Fully Featured Sony Xperia Z4 Camera

Xperia Z4’s hardware may not impress, but its software is definitely … more

Experimental TWRP Available For Moto G 2015

XDA Senior Member squid2 has posted experimental builds of TWRP for the Moto G … more

How to pair a Wireless Xbox 360 Controller and fix Camera Spin

155 posts
Thanks Meter: 146
 
By sleeplessninja, Senior Member on 24th July 2012, 05:25 AM
Post Reply Subscribe to Thread Email Thread
Video that demonstrates the setup, show an example of the problem, the steps to solve the problem, and the working solution!!!
http://www.youtube.com/watch?v=9czISrLGXNI&hd=1


So first lets just talk about the Hardware Setup.
  • Xbox 360 Wireless Controller
  • OTG Cable.
  • Xbox 360 Wireless Dongle (This is meant for the PC but also works on the Android, and quite lovely on emulators)

This setup alone works well for allot of the emulators out there, however some of the games are not working with the controller, for instance GTA3 , Dead Trigger, Shadowgun and others. So by reading the logcat I was able to figure out a solution. Snippet of logcat below

--------------------
07-22 19:55:48.039 350 405 D EventHub: No input device configuration file found for device 'Xbox 360 Wireless Receiver'.
07-22 19:55:48.059 350 405 I EventHub: New device: id=4, fd=269, path='/dev/input/event3', name='
360 Wireless Receiver', classes=0x80000341, configuration='', keyLayout='/system/usr/keylayout/Generic.kl', keyCharacterMap='/system/usr/keychars/Generic.kcm', builtinKeyboard=false, usingSuspendBlockIoctl=true, usingClockIoctl=false

<6>[ 117.819812] usb 2-1: new full speed USB device number 2 using tegra-ehci
<6>[ 117.873142] usb 2-1: New USB device found, idVendor=045e, idProduct=0719
<6>[ 117.873219] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
<6>[ 117.873337] usb 2-1: Product: Xbox 360 Wireless Receiver for Windows
<6>[ 117.873403] usb 2-1: Manufacturer: ©Microsoft
<6>[ 117.873518] usb 2-1: SerialNumber: FE425DB0
-------------------

So when i searched through the /system/usr/keylayout/ I saw there was a profile for the xbox 360 wired controller so I thought why not copy the profile and name it a wireless xbox controller. This idea worked. You name keylayouts by Vendor ID and Product ID which I also was able to get from the logcat. What is nice about this is I think we can use this to solve issues with other controllers as well, but I don't know of any that are also having problems.

For this solution a rooted Nexus 7 is required. I already have a step by step video on rooting if you need the help on the nexus 7. but after obtaining root you need to enter into the Android Shell (i was using Terminal Emulator for Android on the Nexus 7 downloaded from the google play store ) . I entered this commands to get this all setup.

  • su
  • cd /system/usr/keylayout/
  • mount -o remount,rw /system
  • cp Vendor_045e_Product_0291.kl Vendor_045e_Product_0719.kl
  • chmod 644 Vendor_045e_Product_0291.kl
  • chmod 644 Vendor_045e_Product_0719.kl
  • exit
  • exit

Restart System and Enjoy!!!!

UPDATE 2
I attached the Key Character Mapping file as well. This is found in /system/usr/keychars . For nexus 7 users this isn't necessary but some other devices have different generic .kcm so this is needed (in the process of being confirmed) PLEASE NOTE THE .KCM Extension

UPDATE
Some of you do not have the Keylayout file for even the USB Xbox Controller, I am attaching the file (it needs to be unzipped), you will need to paste it into the /system/usr/keylayout/ folder. You also could rename this to the Wireless Xbox Controller Vendor and Product ID and copy it 'Vendor_045e_Product_0719' .
Update 2: When copying the file you still need to mount the Systems folder using the command listed above: "mount -o remount,rw /system" and also remember to modify its priveledges using the
"chmod 644 Vendor_045e_Product_0291.kl"
PLEASE NOTE THE .KL EXTENSION FOR THIS FILE
Attached Files
File Type: zip Vendor_045e_Product_0291.kl.zip - [Click for QR Code] (1.6 KB, 15599 views)
File Type: zip Vendor_045e_Product_0719.kcm.zip - [Click for QR Code] (2.7 KB, 12451 views)
Last edited by sleeplessninja; 9th August 2012 at 04:12 PM. Reason: Updated with Attachment
The Following 86 Users Say Thank You to sleeplessninja For This Useful Post: [ View ]
 
 
24th July 2012, 05:31 AM |#2  
Senior Member
Flag Sumter, S.C. (Not by choice)
Thanks Meter: 116
 
More
Good work!
The Following User Says Thank You to r4d14n7 For This Useful Post: [ View ]
24th July 2012, 05:52 AM |#3  
Zardos66's Avatar
Senior Member
Thanks Meter: 11
 
More
Nice. If I didn't already use PS3 controllers I'd check it out.

Sent from my Nexus S using xda premium
24th July 2012, 06:14 AM |#4  
ptesmoke's Avatar
Senior Member
Flag Cold Lake
Thanks Meter: 753
 
More
So does it have to be the pc version of the xbox controller? Or a regular xbox controller?

Sent from my One X using xda premium
24th July 2012, 06:17 AM |#5  
Member
Thanks Meter: 2
 
More
Is Vendor_045e_Product_0291.kl created when you sync your wireless controller? because I don't have such file on my keylayout folder.
24th July 2012, 06:21 AM |#6  
sleeplessninja's Avatar
OP Senior Member
Flag Amherst
Thanks Meter: 146
 
Donate to Me
More
Post
Quote:
Originally Posted by Cybore

Is Vendor_045e_Product_0291.kl created when you sync your wireless controller? because I don't have such file on my keylayout folder.

Are you using a Rom? I was doing this with a rooted verion of stock 4.1.1.

I'm not at my Nexus 7 for the rest of the night but can upload the file tomorrow if you don't have it. But yes Vendor_045e_Product_0291.kl should be for this to work. In the case its not we will have to push the file to the folder and then set the permission for it.
24th July 2012, 06:22 AM |#7  
UberMudkipz's Avatar
Junior Member
Flag Port Townsend, WA
Thanks Meter: 1
 
More
Quote:
Originally Posted by ptesmoke

So does it have to be the pc version of the xbox controller? Or a regular xbox controller?

Sent from my One X using xda premium

There is no specific controllers to PC or Xbox. A wired controller works with both PC and 360 due to it being a USB connection. A wireless controller still can work with PC if you purchase a wireless adapter. That is what I do: sync up with this PC adapter when I want to play PC games with a controller, and sync the same controller up to my 360 on the off chance I want to play some Halo or something.

Anyway, I assume the same method of hooking up a wired 360 controller to an Android device is applicable as it uses the same drivers as the wireless one, just requires one less piece of equipment.
24th July 2012, 06:22 AM |#8  
sleeplessninja's Avatar
OP Senior Member
Flag Amherst
Thanks Meter: 146
 
Donate to Me
More
Post
Quote:
Originally Posted by ptesmoke

So does it have to be the pc version of the xbox controller? Or a regular xbox controller?

Sent from my One X using xda premium

The controller itself is a regular xbox 360 controller. The dongle is just used on the PC so it can communicate with the controller like a xbox 360 does.
24th July 2012, 08:12 AM |#9  
Member
Thanks Meter: 2
 
More
Quote:
Originally Posted by sleeplessninja

Are you using a Rom? I was doing this with a rooted verion of stock 4.1.1.

I'm not at my Nexus 7 for the rest of the night but can upload the file tomorrow if you don't have it. But yes Vendor_045e_Product_0291.kl should be for this to work. In the case its not we will have to push the file to the folder and then set the permission for it.

Nope, rooted stock 4.1.1 as well. Please upload the file if you get a chance.
24th July 2012, 05:12 PM |#10  
Member
Thanks Meter: 3
 
More
So during cinematics like in Dead Trigger when the Zack gets too close, do you drop the controller and have to touch the screen?

I suck at this game, so that happens to me a LOT.
24th July 2012, 05:18 PM |#11  
sleeplessninja's Avatar
OP Senior Member
Flag Amherst
Thanks Meter: 146
 
Donate to Me
More
Post Updated OP with Attachment
Quote:
Originally Posted by Cybore

Nope, rooted stock 4.1.1 as well. Please upload the file if you get a chance.

Sorry for the delay. I appreciate you bringing this up and I updated the original post to include the attachment. Please let me know how it works out for you.

Quote:
Originally Posted by eawooten

So during cinematics like in Dead Trigger when the Zack gets too close, do you drop the controller and have to touch the screen?

I suck at this game, so that happens to me a LOT.

Yes, as far as i know you can't use the controller, i'd imagine the developers would change this to fix it though. But I was only showing the game to demonstrate the issue not so much discuss its gameplay with the xbox controller. I think there is a thread on here that is discussing this and might even direct you to a petition to Madfinger (developer of dead trigger) to request it to be changed.
The Following User Says Thank You to sleeplessninja For This Useful Post: [ View ]

Read More
Post Reply Subscribe to Thread

Tags
nexus 7, otg, spinning camera, wireless controller, xbox controller wireless
Previous Thread Next Thread