2

This weekend I decided to add the keylayout for an Xbox 360 wired to be able to use it on Android, because now it just only blinks when I connect it.

I searched in the site about other people that could have the same problem (because the tutorial in the internet about only plugin the OTG cable in, and that's not how things go normally), but neither of then could illuminate me.

So far:

  • OTG cable just works fine (I used a pendrive of some years ago, so...)
  • The Xbox 360 wired controller is just a normal one like this (also, it is about 5V and 400mA, maybe the tablet cannot give that much power support? Personally I doubt this, as the ring-shaped connection LED can blink)
  • I created the required vendor files (Vendor_045e_Product_0719.kl, Vendor_045e_Product_0291.kl, Vendor_045e_Product_028e.kl and Vendor_046d_Product_c219.kl are the names I finded so far), setted its permissions (644) and restarted the tablet. The content is the same in all of them:

`

# Copyright (C) 2011 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

#
# XBox 360 USB Controller
#

key 304   BUTTON_A
key 305   BUTTON_B
key 307   BUTTON_X
key 308   BUTTON_Y
key 310   BUTTON_L1
key 311   BUTTON_R1
key 314   BUTTON_SELECT
key 315   BUTTON_START
key 316   BUTTON_MODE
key 317   BUTTON_THUMBL
key 318   BUTTON_THUMBR

# Left and right stick.
# The reported value for flat is 128 out of a range from -32767 to 32768, which is absurd.
# This confuses applications that rely on the flat value because the joystick actually
# settles in a flat range of +/- 4096 or so.
axis 0x00 X flat 4096
axis 0x01 Y flat 4096
axis 0x03 Z flat 4096
axis 0x04 RZ flat 4096

# Triggers.
axis 0x02 LTRIGGER
axis 0x05 RTRIGGER

# Hat.
axis 0x10 HAT_X
axis 0x11 HAT_Y

`

So I decided to see what the log was saying. I did a logcat and then...

u0_a81@Aquaris_M10:/ # cat /sdcard/my-log-file.txt | grep Microsoft
01-20 16:03:04.340   731  1018 D UsbAlsaManager: deviceRemoved(): Microsoft Corporation Controller
01-20 16:03:07.971   731  1018 D UsbHostManager: Added device UsbDevice[mName=/dev/bus/usb/001/005,mVendorId=1118,mProductId=654,mClass=255,mSubclass=255,mProtocol=255,mManufacturerName=Microsoft Corporation,mProductName=Controller,mVersion=2.0,mSerialNumber=15E8D53,mConfigurations=[
01-20 16:03:07.971   731  1018 D UsbHostManager: UsbInterface[mId=3,mAlternateSetting=0,mName=Xbox Security Method 3, Version 1.00,  2005 Microsoft Corporation. All rights reserved.,mClass=255,mSubclass=253,mProtocol=19,mEndpoints=[]]]
01-20 16:03:07.993   731  1018 D UsbAlsaManager: deviceAdded(): Microsoft Corporationnm:Controller
01-20 16:03:33.424   731  1018 D UsbAlsaManager: deviceRemoved(): Microsoft Corporation Controller
01-20 16:03:36.930   731  1018 D UsbHostManager: Added device UsbDevice[mName=/dev/bus/usb/001/006,mVendorId=1118,mProductId=654,mClass=255,mSubclass=255,mProtocol=255,mManufacturerName=Microsoft Corporation,mProductName=Controller,mVersion=2.0,mSerialNumber=15E8D53,mConfigurations=[
01-20 16:03:36.930   731  1018 D UsbHostManager: UsbInterface[mId=3,mAlternateSetting=0,mName=Xbox Security Method 3, Version 1.00,  2005 Microsoft Corporation. All rights reserved.,mClass=255,mSubclass=253,mProtocol=19,mEndpoints=[]]]
01-20 16:03:36.951   731  1018 D UsbAlsaManager: deviceAdded(): Microsoft Corporationnm:Controller
u0_a81@Aquaris_M10:/ #

There you can see that the vendor and product IDs are different (1118 and 654 respectively), so I tried to make another vendor file (Vendor_1118_Product_654.kl), setted its permissions, and restarted. But keeps the same. It is supossed to let you navigate over it, selecting apps and also, but nothing. I also tried playing Asphalt Nitro (looks like those are some of the games with support for controllers) with no luck.

It's my first time into Android, and so far all good tutorials just say to copy those vendor files, set their permissions, and then restart. But for me it isn't working.

My Android's version is 6.0. I don't know if you need the kernel' and compilation number, but tell me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.