Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
sleeplessninja
Old
(Last edited by sleeplessninja; 9th August 2012 at 04:12 PM.) Reason: Updated with Attachment
#1  
sleeplessninja's Avatar
Senior Member - OP
Thanks Meter 122
Posts: 155
Join Date: Mar 2011
Location: Amherst

 
DONATE TO ME
Tutorial How to pair a Wireless Xbox 360 Controller and fix Camera Spin

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
Sensei Sleepless
Check out my Video Channel for Daily Android App Video Overview
http://www.youtube.com/sleeplessninjas

Sleepless Ninja Blog
http://www.sleeplessninja.com
The Following 62 Users Say Thank You to sleeplessninja For This Useful Post: [ Click to Expand ]
 
r4d14n7
Old
#2  
Senior Member
Thanks Meter 112
Posts: 677
Join Date: Jun 2009
Location: Sumter, S.C. (Not by choice)
Good work!
T-Mobile G2x
CM 7.2

Nexus 7 (16GB)
Rooted Stock

"Okay, listen. We should get our stories straight, alright? If anyone asks - and no one's gonna ask, don't worry - but if anyone asks, tell them as far as you know, the last time you checked, everyone looked pretty much alive. Alright? Not dead."
-Wheatley
 
Zardos66
Old
#3  
Zardos66's Avatar
Senior Member
Thanks Meter 11
Posts: 364
Join Date: Jun 2010
Nice. If I didn't already use PS3 controllers I'd check it out.

Sent from my Nexus S using xda premium

 
ptesmoke
Old
#4  
ptesmoke's Avatar
Senior Member
Thanks Meter 562
Posts: 2,320
Join Date: Sep 2008
Location: Cold Lake
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
Nexus 4 - CM10.1 Nightlies
Nexus 7 - CM10.1 Nightlies
Samsung i9100 - CM10.1 Nightlies

Retired:HTC One X+,HTC One X,Samsung Captivate, Acer Iconia A100, HTC Desire z, HTC Desire, Acer Liquid MT, Sony Xperia X10, HTC Touch Pro, HTC Diamond, HTC Touch, HTC Titan
 
Cybore
Old
#5  
Member
Thanks Meter 2
Posts: 49
Join Date: Mar 2011
Is Vendor_045e_Product_0291.kl created when you sync your wireless controller? because I don't have such file on my keylayout folder.
 
sleeplessninja
Old
#6  
sleeplessninja's Avatar
Senior Member - OP
Thanks Meter 122
Posts: 155
Join Date: Mar 2011
Location: Amherst

 
DONATE TO ME
Quote:
Originally Posted by Cybore View Post
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.
Sensei Sleepless
Check out my Video Channel for Daily Android App Video Overview
http://www.youtube.com/sleeplessninjas

Sleepless Ninja Blog
http://www.sleeplessninja.com
 
UberMudkipz
Old
#7  
UberMudkipz's Avatar
Junior Member
Thanks Meter 1
Posts: 15
Join Date: Feb 2012
Location: Port Townsend, WA
Quote:
Originally Posted by ptesmoke View Post
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.
Motorola Droid X2:
Unofficial CyanogenMod 10 - RC0 [dragonzkiller]
_______________________________

Asus Nexus 7 (16Gb):
CyanogenMod 10 Nightly - 4.1.2
franco.Kernel r23
 
sleeplessninja
Old
#8  
sleeplessninja's Avatar
Senior Member - OP
Thanks Meter 122
Posts: 155
Join Date: Mar 2011
Location: Amherst

 
DONATE TO ME
Quote:
Originally Posted by ptesmoke View Post
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.
Sensei Sleepless
Check out my Video Channel for Daily Android App Video Overview
http://www.youtube.com/sleeplessninjas

Sleepless Ninja Blog
http://www.sleeplessninja.com
 
Cybore
Old
#9  
Member
Thanks Meter 2
Posts: 49
Join Date: Mar 2011
Quote:
Originally Posted by sleeplessninja View Post
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.
 
eawooten
Old
#10  
eawooten's Avatar
Member
Thanks Meter 2
Posts: 59
Join Date: Jul 2009
Location: Dallas

 
DONATE TO ME
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.
  • Google Nexus 7 - "The Silver Surfer"
  • Barnes and Noble Nook Color - "Hulk"
  • T-Mobile Vibrant - "Venom"
  • Black HTC Dream G1 - "War Machine"

 
Post Reply+
Tags
nexus 7, otg, spinning camera, wireless controller, xbox controller wireless
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Go to top of page...