OK, I got it
Yeeey!
It requires editing android system, so you have to be rooted.
* install KeyEvent Display from Play Store (
https://play.google.com/store/apps/detai...play&hl=en)
* run KeyEvent Display app
* press the keys you want to find out keycodes. They will be displayed. Note the codes. In my case 155 and 217 (envelope and search)
* Install
ES File Explorer from Play Store, turn on root in it and give it root rights.
* From ES, navigate to /proc/bus/input
* copy devices file to your SD card, or just view it from ES.
* in the list of devices, find your keyboard. Mine looks like this:
Code:
I: Bus=0003 Vendor=1997 Product=7b03 Version=0110
N: Name=" Multimedia Air Mouse Keyboard"
P: Phys=usb-dwc2_b-1.2/input0
S: Sysfs=/devices/dwc2_b/usb1/1-1/1-1.2/1-1.2:1.0/0003:1997:7B03.0001/input/input4
U: Uniq=
H: Handlers=sysrq kbd event4
B: PROP=0
B: EV=120013
B: KEY=10000 7 ff9f207a c14057ff febeffdf ffefffff ffffffff fffffffe
B: MSC=10
B: LED=1f
* note Vendor and Product. In my case Vendor=1997 Product=7b03
* Now, go to /system/usr/keylayout in ES
* copy file Generic.kl to your PC for editing
* rename file Generic.kl to Vendor_<vendor>_Product_<product>.kl, i.e. in my case "Vendor_1997_Product_7b03.kl"
* download EditPad Lite if you don't have good editor. DO NOT USE notepad. The file must be in UNIX format (LF only)
* edit the file - find the keys noted in step 3, i.e. I edited key 217 to MEDIA_PLAY and key 155 to MEDIA_STOP:
Code:
key 155 MEDIA_STOP
key 217 MEDIA_PLAY
* save file, pay attention that the output uses LF as line breaks (UNIX standard)
* copy file to your Android box
* copy file to /system/usr/keylayout
* set permissions to 644 (just look what other files in this folder have) - -rw-r--r--
* reboot
* enjoy!