Tested on Android 4.2.2 a lot of gamepads in the store, all the same in terms of android perception. So that I advise you - buy the cheapest gamepad, plug it through OTG, then
Find it in the / proc / bus / input / devices file, record the numbers after Vendor (hereinafter referred to as Vendor) and Product (hereinafter referred to as the product);
Edit / create file /system/usr/keylayout/Vendor_VENDOR_Product_PRODUCT.kl
in the file to register
key 288 BUTTON_A
key 289 BUTTON_B
key 290 BUTTON_X
key 291 BUTTON_Y
Key 294 Button_l1
Key 295 Button_r1
Key 292 Button_L2.
Key 293 Button_r2.
key 296 BUTTON_SELECT
key 297 BUTTON_START
axis 0x00 X
axis 0x01 Y
axis 0x02 Z
axis 0x03 RX
axis 0x04 RY
axis 0x05 RZ
axis 0x06 THROTTLE
axis 0x07 RUDDER
axis 0x08 WHEEL
axis 0x09 GAS
axis 0x0a BRAKE
axis 0x10 HAT_X
axis 0x11 HAT_Y
And the gamepad will work true in all games, including the GTA series and other jesters. The file of course you can edit and reassign buttons to others. Thank you very much ganster41, with his help I figured out, I didn't find any advice on this problem in Google (including English-speaking forums) And the problem is all the fact that the GamePad Tester does not correctly write the codes of the read buttons, so you need the Keynumbertracker.apk program
http: //forum.xda-devel...48758256&postcount=595It correctly reads the buttons codes after you write all the codes in the GamePadTest file will be correct to read them already as needed. And the main thing in the games they will work correctly. I think it's worth it in the FAQ.