I tried to follow this solution, but the problem is that my device is a Galaxy Tab 3, not a Galaxy S6.
I am connecting the receiver to the tablet using an OTG cable (which works, because I tried a mouse with it). The XBOX 360 wireless controller is just not pairing up with the receiver, the lights keeps flashing.
The problem with the solution I tried is that I cannot run the command:
cp Vendor_045e_Product_0291.kl Vendor_045e_Product_0719.kl
Because the file Vendor_045e_Product_0291.kl
does not exist. There are files with similar names but I don't know which one I have to copy and probably even it needs a different renaming… I don't know. Does anyone know which file I need to use?
Or is there an easier solution?
Best Answer
The answer you linked is giving the instructions for people to copy a KeyLayout file (
Vendor_045e_Product_0291.kl
) to another file (Vendor_045e_Product_0719.kl
), so that the Operating System can match the product ID1 of your device against the KeyLayout file intended for an older (but compatible) version of the device.However, the description of your problem isn't enough to give a conclusive answer.
From what I know, the controller will be able to work with an Android device even though it is not visually "pairing" (as indicated by the LEDs around the XBox button).
To connect to your controller, the android device will require an existing driver in the first place.
So the first thing you should do is plug it, follow the steps you have followed the first time you connected your controller to your computer2, and then try the controller out. This will help you determine if there is a driver present for the device: If yes, using it should allow to change the selection of your icons on your desktop, or at least have a visual effect upon activation. Else, chances are that you are missing the driver for the XBox controller; which is a much more difficult file to find than a configuration file (such as a KeyLayout file).
In case you are missing a driver:
Drivers need to fit your hardware (architecture, devices) and software (kernel, possibly libraries). You usually cannot transfer them around between devices and have them "just work". If you miss a driver, you will need to get one that matches the exact same android version and the exact same hardware (i.e one precisely for your controller)
So, short of finding a pre-compiled driver for your device somewhere, you would need to find the source code for this driver and compile it yourself; which isn't an easy task3 and then, even if you have the sources, you would need to compile them, probably without documentation or assistance, which will certainly prove challenging.
You however have a few options to try, before giving up, if you are missing the Xbox controller driver for your Galaxy Tab:
Note that I tried to sort those options in an ascending time cost manner, so that the first ones should yield a (positive or not) result faster.
Also, an important note is that I was told on the LineageOS IRC channel that it is usually easier to re-build the whole image for a device than to add a driver to it.
In case you are just missing the KeyLayout file:
If your controller "sort of" works but you are getting unwanted behavior with it, you are most probably missing a KeyLayout file.
This is the problem that corresponds to the solution you are describing in your question.
However, you cannot take a random KeyLayout file, copy it over with the
Vendor_045e_Product_0719.kl
4 name, and expect it to work.The file that you would copy to
Vendor_045e_Product_0719.kl
should match the configuration of your input device, or it will not solve the problem of having an inconsistent input. (Vendor_045e_Product_0291.kl
should such a file, since it is for the XBox 360 Wireless Controller, but maybe there are others: search (on your favorite search engine - a quick search gave me045E:02A1
, and maybe also045E:028F
) what ProductID the Xbox 360 controllers can have, to get the full list).You can also attempt to create the missing KeyLayout file by following the process described here.
In any case, if your controller is recognized but has the wrong behavior, it is a much easier problem to solve.
Footnotes:
XXXX:YYYY
whereXXXX
is the vendor ID andYYYY
is the product ID. In your case that would give045E:0291
and045E:0719
(045E
is a vendorID from Microsoft).045E:0719
hardware identifier is the one of your device. If it is not, you will need to find the correct hardware identifier before continuing. To find out if it is, uselsusb
on GNU/Linux or the Microsoft® Windows™ Device Manager while plugging your XBox 360 Wireless Receiver to your computer.