Assistant
REPLY |
Native support for input devices | Native support for DIY input devices. |
Message#1 12.12.14, 16:42 | |
Professional Dreamer [offline] Group: Developers Messages 11606 Check in: 04.04.07 Xiaomi Redmi Note 4X Snapdragon 4/64 Reputation: 1156 | This topic is a continuation of the article.//savagemessiahzine.com/2014/12/12/190359/ Here we discuss how to create native support for input devices and share ready-made solutions. Tools Tools:
Also, these applications can be downloaded on the forumNative support for input devices (Post # 36465278) Step one. VID and PID 1. Creating a file with VID and PID We connect our input device and launch the USB Device Info application. We are interested in the Linux tab, in which we select our device (I had it last in the list) and look for the values of the Vendor ID and Product ID lines. In my case it was 0c45 and 7700, respectively. Also VID and PID can be viewed by connecting the device to the PC. For Bluetooth devices: You can find these values for Bluetooth devices by opening the file / proc / bus / input / devices. Copy any file from / system / usr / keylayout to sdcard and rename it according to the received data; for my joystick, the name is:Vendor_0c45_Product_7700.kl . (Note that letter case does matter) Step two. Getting button codes. 2. Getting Button Codes Launch the KeyTest application and, armed with paper and a pencil, we start alternately pressing the buttons on the device, recording the numbers displayed after scanCode =. I wrote down the codes, placing them on paper, like buttons on a gamepad. From the program you can exit only by the button "Home". ATTENTION! If Gamepad is visible in the first step, butKeytest does not respond on pressing, you may not have the required module in the kernel - say "thank you" to the author of the firmware. But do not despair, there is a possible solution.Native support for input devices (Post wm-hater # 52134473) Step three. Mapping buttons. 3. Mapping buttons Now that the codes for all keys have become known, it is necessary to prescribe their functions. There are two ways: a) find a device among the configs available in Android that is as close as possible to yours, and simply change the button codes in it by copying the contents to your file; b) prescribe everything yourself. I went the second way, because my joystick has only a control cross and four buttons. First you need to understand the syntax of the file layout, it is very simple: key button code action_key But then the question arose: what actions of the buttons to write in the config? For many years of using various gamepads on Android, I have determined for myself that the most universal config is the Sony Xperia Play layout, it behaves equally well in games and in the system interface. Ok Google key mapping for Xperia Play Key code constant scancode X 23 KEYCODE_DPAD_CENTER 304 circle 4 KEYCODE_BACK 305 square 99 KEYCODE_BUTTON_X 307 triangle 100 KEYCODE_BUTTON_Y 308 up 19 KEYCODE_DPAD_UP 106 down 20 KEYCODE_DPAD_DOWN 105 left 21 KEYCODE_DPAD_LEFT 103 right 22 KEYCODE_DPAD_RIGHT 108 select 109 KEYCODE_BUTTON_SELECT 314 start 108 KEYCODE_BUTTON_START 28 L trigger 102 KEYCODE_BUTTON_L1 310 R trigger 103 KEYCODE_BUTTON_R1 311 We are interested in the third column, but the record of actions in it is slightly different from those that were found in the system - this is not an obstacle, just remove KEYCODE_. I register my buttons (remember the sheet of pencil notes? It's time to find it ...): !!! ATTENTION !!! Need a text editor with support for unix encoding! Notepad from Windows is NOT suitable, Use, for example, Notepad ++ key 147 DPAD_CENTER key 149 BUTTON_B key 148 BUTTON_Y key 146 BUTTON_X key 157 DPAD_DOWN key 145 DPAD_LEFT key 155 DPAD_UP key 156 DPAD_RIGHT But here it was not without nuances. At Sony, the KEYCODE_BACK action (the “back” button, which is familiar to us, is assigned to the “circle” button). It is easy to guess that pressing such a button in the game can cause a nervous breakdown. And the thing is that during the game on Xplay, this button takes an alternative value - KEYCODE_BUTTON_B. Here we prescribe it. The offset along the axis is written as: axis 0x00 HAT_X axis 0x01 HAT_Y Step Four. The moment of truth. 4. The moment of truth Save our file and copy it to the / system / usr / keylayout folder. Set rights -rw -r -r (644). We reboot the device (I didn’t do this myself, just blocked and unlocked, but for the purity of conscience and experiment I had to write it). We connect our device, and if everything is done correctly, then you can immediately use the “crossbar” to navigate the Android menu. The button assigned to DPAD_CENTER will be the select button, and BUTTON_B the back button. Problems and possible solutions Q:I prescribe everything correctly, but the config does not cling. BUT: If you register action codes with an error, for example: key 123BUTTON_HOMEinstead of key 123HOME then the system will consider this file erroneous. The best way to check if your kl file is picked up by the system or not is to erase all keycodes or comment them out with a # sign: #key 123 BUTTON_HOME If the file is picked up - there will be no reaction to the buttons, but everything will be displayed in KeyTest. Q:I prescribe everything correctly and without errors, but all or part of the buttons do not work. BUT: Try writing scancode in hex format: Native support for input devices (Post romanctest # 69194647) Q:Dualshok 4 constantly falls off or works with a delay. BUT: Native support for input devices (Post maxmergov # 81264882) Useful links: About buttons:https: //developer.andr...id/view/KeyEvent.html# About axles:https: //developer.andr.../controller-input.html About the values and structure of the config:https: //source.android...input/key-layout-files Video instruction if the letters are tight. Ready * .kl files Template for laying out the finished files [COLOR = royalblue] [B] Device Name [/ B] [/ COLOR] [SPOILER = Image] Place the image here [/ SPOILER] Attach zip archive with * .kl file # ! QU RacePad A acme ga-05 Acme Pro GA-03 D Defender Racer Wireless PRO Dualshock 4 Dual Shock (Not original wired and wireless) Dialog GP-A11 Dialog GP-A11RF (no wired version) Defender Mobile Master Defender Game Racer X7 E EXEQ NEONLight EXEQ Spitfire EXEQ MechWarrior G Genius MaxFire Pandora Pro Genius Maxfire G12 Wireles Genius MaxFire G-12U Vibration Gembird JPD-Dualforce2 Genius Maxfire Blaze 3 I iPEGA 9023 ipega 9025 Ipega-9017 ipega 9028 L Logitech rumblepad 2 Logitech Wireless Gamepad F710 Logitech f710 wireless Logitech Gamepad F310 (USB) Logitech Rumble Gamepad F510 (USB) Logitech chillstream controller M MEEP! Joystick N Nyko playpad / playpad pro O Oklick GP-315M S SpeedLink TORID SL-6576-BK-01 Saitek P2500 Rumble Force PAD Speedlink strike gamepad white SVEN X-Pad Startex doubleshock T Thrustmaster Dual Analog 4 W WAMO G910 / Pro X Xiaomi gamepad Xbox 360 wireless receiver Xbox controllerler Cap in design mode. Post has been editedDreamer ... - 14.01.19, 21:22 |
Message#2 12.12.14, 18:23 | |
User [offline] Group: Friendssavagemessiahzine.com Messages 94 Check in: 09.06.11 Sony Xperia Z1 Compact Reputation: 7 | and clave with a mouse for wot blitz so it will be possible to sip? -------------------- I'm not sad, just sober |
Message#3 12.12.14, 18:42 | |
Visitor [offline] Group: Users Messages 10 Check in: 06.10.12 Sony Ericsson Live with Walkman Reputation: 1 | usb device info joystick sees, but keytest does not see. What to do cm11 |
Message#4 12.12.14, 19:37 | |
Stalker - alive! [offline] Group: Friendssavagemessiahzine.com Messages 625 Check in: 22.12.13 Reputation: 23 | -------------------- ���� �� ������ ��������� ��������� �� �����������. downloadUMIDIGI Z Pro (7.1.1 stock)/ Sunmaid RB-10 (4.0.4 stock) / XingHan AN1 (4.0.4 stock) (BootLoop) |
Message#5 12.12.14, 21:27 | |
Visitor [offline] Group: Active users Messages 21 Check in: 29.08.13 Samsung Galaxy Ace Plus GT-S7500 Reputation: 1 | I have an interesting situation. Gamepad Defender, without sticks, without vibration, is determined by the tablet machine. And it scrolls through the menus and even works in games (although not always as it should, but it depends on the game). But Logitech F310 doesn’t want to be defined in the system, only the USB / BT Joy program helps. Moreover, the config (or driver) for the latter is in the keylaout, but not for the Defender. |
Message#6 12.12.14, 21:47 | |
Only hardcore [offline] Group: Curators Messages 4851 Check in: 27.12.12 Reputation: 356 | Dreamer ..., I think that the link toReassigning the functions of buttons on android devices, as well as the fact that you can see the VID | PID through the Windows Device Manager. |
Message#7 12.12.14, 23:37 | |
Professional Dreamer [offline] Group: Developers Messages 11606 Check in: 04.04.07 Xiaomi Redmi Note 4X Snapdragon 4/64 Reputation: 1156 | ivanew,in theory you can. Pinfo4ertry to create an empty .kl file, reboot and check in keyTest again. Shadow326159and keikody prescribed? Posted 12.12.2014, 23:37: But are the values of the buttons in it correct? ottiwell,Yes. You can view this info in any system. -------------------- Dell Streak 7 WiFI ->Google Nexus 7 (2012) SlimKat 4.4.4 |
Message#8 13.12.14, 00:24 | |
Local [offline] Group: Friendssavagemessiahzine.com Messages 129 Check in: 24.04.09 Huawei MediaPad X1 7.0 Reputation: 7 | -------------------- SE XPERIA SK17i => Ritmix RMD-520 =>Rover t74L => My configuration |
Message#9 13.12.14, 00:43 | |
a guest [offline] Group: Users Messages 1 Check in: 02.04.13 Samsung Galaxy S3 GT-I9300 Reputation: 2 | Damn the whole evening, I got drunk with a PS4 gamepad, but it came out not without someone else's effort! Dualshock 4, although it is connected without any settings, doesn’t work properly, because the settings from Dualshock 3. I decided to fix them a little and then it started .... KeyTest sees only the key codes and does not track the axis (although it can and tracks it, but I did not get along) and DPAD doesn’t work that way. In general, I found out who did most of the work for me, although the guys there were doing something else, they were screwing Dualshock 4 to Amazon Fire TV for which thanks. http: //forum.xda-devel…rrect-keymaps-t2817223 In the end, I redid it a bit, well, everything, or rather, the majority earned. Checked on SGS3 and asphalt 8. It is only necessary to change the extension from txt to kl. Attached files Vendor_054c_Product_05c4.txt(1.22 KB) Post has been editedspace_cat - 13.12.14, 00:44 |
Message#10 13.12.14, 00:55 | |
Local [offline] Group: Friendssavagemessiahzine.com Messages 361 Check in: 10.04.14 HTC One M7 Reputation: 10 | Guys, I can not download Key Test for the link ...? |
Message#11 13.12.14, 01:44 | |
User [offline] Group: Friendssavagemessiahzine.com Messages 96 Check in: 29.11.12 Reputation: 1 | guys, put the action codes under dualshock or xbox controller what to prescribe so under gta sa -------------------- Nokia e52>>Gsmart g1342>>Xiaomi mi2s>>x2 HTC Droid DNA Unlock | S-OFF | Roted | Android 4.4.2 (Stock 4.09.605.1) & Android 4.4.2 (Stock 4.09.605.5) |
Message#12 13.12.14, 02:42 | |
Experienced [offline] Group: Friendssavagemessiahzine.com Messages 443 Check in: 07.07.11 Reputation: 11 | Here is the finished file for such a joey.http://www.exeq.ru/pro..orma-pc/neonlight.html Attached files EXEQ NEONLight.zip(534 bytes) Post has been editedbati7 - 13.12.14, 02:50 |
Message#13 13.12.14, 04:10 | |
Local [offline] Group: Friendssavagemessiahzine.com Messages 361 Check in: 10.04.14 HTC One M7 Reputation: 10 | Can someone post the installation apk KeyTest? Why through the cloud, does he weigh less than a canary? Post has been editedDranyonito - 13.12.14, 04:10 |
Message#14 13.12.14, 06:45 | |
Stalker - alive! [offline] Group: Friendssavagemessiahzine.com Messages 625 Check in: 22.12.13 Reputation: 23 | No, I took it from xbox360 and just renamed it, threw it and set the rights. -------------------- People mistakenly take complexity for sophistication. UMIDIGI Z Pro (7.1.1 stock)/ Sunmaid RB-10 (4.0.4 stock) / XingHan AN1 (4.0.4 stock) (BootLoop) |
Message#15 13.12.14, 13:08 | |
INTO [online] Group: Curators Messages 2404 Check in: 09.11.11 Xiaomi Redmi 3X Reputation: 155 | With bluetooth joey nobody understood? I have an Ipega pg-9025, how do I determine the Vendor / Product ID? -------------------- There are two endless things - the universe and human stupidity. User! In order not to advertise your public view to everyone, if you please, please read the topic you are interested in! For nefig! imin |
Message#16 13.12.14, 13:50 | |
Visitor [offline] Group: Users Messages 10 Check in: 06.10.12 Sony Ericsson Live with Walkman Reputation: 1 | |
Message#17 13.12.14, 14:00 | |
User [offline] Group: Friendssavagemessiahzine.com Messages 96 Check in: 29.11.12 Reputation: 1 | With bluetooth joey nobody understood? I have an Ipega pg-9025, how do I determine the Vendor / Product ID? And yes, there is a question of determining BT devices -------------------- Nokia e52>>Gsmart g1342>>Xiaomi mi2s>>x2 HTC Droid DNA Unlock | S-OFF | Roted | Android 4.4.2 (Stock 4.09.605.1) & Android 4.4.2 (Stock 4.09.605.5) |
Message#18 13.12.14, 15:26 | |
Only hardcore [offline] Group: Curators Messages 4851 Check in: 27.12.12 Reputation: 356 | [email protected], 03:10 Can someone post the installation apk KeyTest? Attached files KeyTest.apk(13.72 KB) USBDeviceInfo.apk(63.84 KB) |
Message#19 13.12.14, 20:37 | |
Professional Dreamer [offline] Group: Developers Messages 11606 Check in: 04.04.07 Xiaomi Redmi Note 4X Snapdragon 4/64 Reputation: 1156 | MEEP! Joystick Picture MEEP Joystick.zip(618 bytes) Genius MaxFire Pandora Pro Genius MaxFire Pandora Pro.zip(634 bytes) Post has been editedDreamer ... - 13.12.14, 20:37 -------------------- Dell Streak 7 WiFI ->Google Nexus 7 (2012) SlimKat 4.4.4 |
Message#20 13.12.14, 21:11 | |
Professional Dreamer [offline] Group: Developers Messages 11606 Check in: 04.04.07 Xiaomi Redmi Note 4X Snapdragon 4/64 Reputation: 1156 | But Logitech F310 doesn’t want to be defined in the system, only the USB / BT Joy program helps. Moreover, the config (or driver) for the latter is in the keylaout, but for Defender it is not Once USB / BT Joy sees, it means you can set up a native definition [email protected], 00:24 Well, what about wireless devices? Posted in cap [email protected], 01:44 guys, put the action codes under dualshock or xbox controller Under xbox and dualshock are already built into the system + above they wrote and uploaded the finished file. [email protected], 14:00 I was helped to find the buttons via KeyTest "scan code", and their change in Generic.kl The change in Generic.kl is not the most elegant way. No, I took it from xbox360 and just renamed it, threw it and set the rights. Well, the keikods may not be the same. -------------------- Dell Streak 7 WiFI ->Google Nexus 7 (2012) SlimKat 4.4.4 |
Message#21 13.12.14, 21:44 | |
Local [offline] Group: Friendssavagemessiahzine.com Messages 361 Check in: 10.04.14 HTC One M7 Reputation: 10 | |
mobile version | Now: 04/28/19, 20:48 |