[GUIDE] Fix: Headset Controls Not Working on Custom Roms - Xiaomi Redmi Note 5 / 5 Plus Guides, News, & Discu

The Problem: The Volume Up and Volume Down Keys of my Headset; Xiaomi Earphone Mi Hybrid Pro HD 2, did not work on my Redmi 5 Plus build.
Using KeyTest App, I identified that the keys were not mapped to any function.
How to fix;
Code:
In /system/usr/keylayout/Generic.kl
Change:
Code:
key 257 BUTTON_2
key 258 BUTTON_3
To
Code:
#key 257 BUTTON_2
#key 258 BUTTON_3
key 257 VOLUME_UP
key 258 VOLUME_DOWN
Save and reboot.
Should work here after.
Edit: If anyone is having issues with Apple earphones, let me know, I can try to see what changes need to be done.
If anyone is facing any issues please let me know and I will update with better more specific instructions.

RAZR-93 said:
Edit: If anyone is having issues with Apple earphones, let me know, I can try to see what changes need to be done.
If anyone is facing any issues please let me know and I will update with better more specific instructions.
Click to expand...
Click to collapse
This how to will be nice, too.
And thanks my Sony headset work now.

Sure I'll look into putting together a general how to for all devices with same issue will be out in a day or two.

Thanks.
Can send me a Pm when u're finish, please?
I've two generations of the iPhone headset.

RAZR-93 said:
The Problem: The Volume Up and Volume Down Keys of my Headset; Xiaomi Earphone Mi Hybrid Pro HD 2, did not work on my Redmi 5 Plus build.
Using KeyTest App, I identified that the keys were not mapped to any function.
How to fix;
Code:
In /system/usr/keylayout/Generic.kl
Change:
Code:
key 257 BUTTON_2
key 258 BUTTON_3
To
Code:
#key 257 BUTTON_2
#key 258 BUTTON_3
key 257 VOLUME_UP
key 258 VOLUME_DOWN
Save and reboot.
Should work here after.
Edit: If anyone is having issues with Apple earphones, let me know, I can try to see what changes need to be done.
If anyone is facing any issues please let me know and I will update with better more specific instructions.
Click to expand...
Click to collapse
Hey I'm kinda new to this. I have root. I would like to know how to do this.
I have a redmi note 10 pro.

RAZR-93 said:
The Problem: The Volume Up and Volume Down Keys of my Headset; Xiaomi Earphone Mi Hybrid Pro HD 2, did not work on my Redmi 5 Plus build.
Using KeyTest App, I identified that the keys were not mapped to any function.
How to fix;
Code:
In /system/usr/keylayout/Generic.kl
Change:
Code:
key 257 BUTTON_2
key 258 BUTTON_3
To
Code:
#key 257 BUTTON_2
#key 258 BUTTON_3
key 257 VOLUME_UP
key 258 VOLUME_DOWN
Save and reboot.
Should work here after.
Edit: If anyone is having issues with Apple earphones, let me know, I can try to see what changes need to be done.
If anyone is facing any issues please let me know and I will update with better more specific instructions.
Click to expand...
Click to collapse
Its not working in lineage os ,, is there any other way to make it work?

Related

[Q] Assign keyboard shortcuts to letters?

I'd like to assign the two hardware keyboard shortcut keys to letters, specifically ä (a umlaut) and ö (o umlaut), also with the possibility for a Shift+Shortcut macro for uppercase. How would I achieve this?
Unrooted DZ running Android 2.3.3
600 views, zero responses?
Really?
not possible without rooting device
Hi,
Hardware keyboard mapping files are at /system/usr/keylayout and /system/usr/keychars on the device. I think that those two shortcut keys are KEY 184 and 186 but I'm not sure about that.
But to modify any files under /system you would need to root your device and I'm not sure if it is possible with Android 2.3.3 version without downgrading.
I have my device rooted and I have the same problem as you do. I'll update this thread if I find out how to modify the mapping files to produce ä and ö.
Sami
debugged this a bit further.
seems that my device is using keyboard:
MacBook-Prolatform-tools root# adb shell getprop | grep keyboard
[hw.keyboards.65537.devname]: [curcial-oj]
[hw.keyboards.0.devname]: [vision-keypad-wwe]
[hw.keyboards.65539.devname]: [vision-keypad-wwe]
[hw.keyboards.65542.devname]: [projector-Keypad]
[hw.keyboards.65544.devname]: [h2w headset]
which translates to the fact that my device is using files /system/usr/keylayout/vision-keypad-wwe.kl and /system/usr/keychar/vision-keypad-wwe.kcm.bin for hardware keyboard mapping
vision-keypad-wwe.kl is just a text file with key numbers mapped to functions. And on my device ...1 and ...2 shortcut keys are keys 184 and 185 (can check that with ClockworkMod key test)
vision-keypad-wwe.kcm.bin is a binary file where the keyboard is actually defined. I found a nice tool to dump the contents of those files here github.com/aglasgall/g2-keymap
with the tool I was able to dump my keymap as follows:
# of keys: 58
0 0 0 0 0 0
1 1 1 1 1 1
2 2 2 2 2 2
3 3 3 3 3 3
4 4 4 4 4 4
5 5 5 5 5 5
6 6 6 6 6 6
7 7 7 7 7 7
8 8 8 8 8 8
9 9 9 9 9 9
STAR * * * * *
POUND # # # # #
A a A ! 2 A
B b B + 2 B
C c C _ 2 C
D d D $ 3 D
E e E 3 3 E
F f F % 3 F
G g G & 4 G
H h H * 4 H
I i I 8 4 I
J j J ( 5 J
K k K ) 5 K
L l L / 5 L
M m M ' 6 M
N n N = 6 N
O o O 9 6 O
P p P 0 7 P
Q q Q 1 7 Q
R r R 4 7 R
S s S # 7 S
T t T 5 8 T
U u U 7 8 U
V v V - 8 V
W w W 2 9 W
X x X x 9 X
Y y Y 6 9 Y
Z z Z z 9 Z
COMMA , , ; ^@ ,
PERIOD . . : ^@ .
TAB 0x9 0x9 0x9
SPACE 0x20 0x20 0x20
ENTER 0xa 0xa 0xa
SPACE 0x20 0x20 0x20
ENTER 0xa 0xa 0xa
GRAVE ` ~ ` ` `
MINUS - _ - - -
EQUALS = + = = =
LEFT_BRACKET [ { [ [ [
RIGHT_BRACKET ] } ] ] ]
BACKSLASH \ | \ \ \
SEMICOLON ; : ; ; ;
APOSTROPHE ' " ' ' '
SLASH / ? ? / /
AT @ @ ~ ^@ @
PLUS + + + + +
FUNC_1 0xef01 0xef01 0xef01 ^A ^A
FUNC_2 0xef02 0xef02 0xef02 ^B ^B
FUNC_3 0xef03 0xef03 0xef04 ^C ^C
QUECHAR ? ? " ^@ ?
seems that there is no ä (a umlaut) or ö (o umlaut) defined by default. So in order to replace shortcut 1 and shortcut 2 with ä and ö those need to be added to the binary file first before they can be mapped on .kl file.
Will keep on investigating
Wowww thanks immensely! This will definitely be a worthy reason for rooting. You're a wizard, I hope you find something. I'm not that tech-savvy by a long shot.
I have managed to create vision-keypad-wwe.kl and vision-keypad-wwe.kcm.bin files that are entirely based on the original ones pulled form the device (HTC Desire Z running Android 2.2) Just changed
:.1 = ä, shift-:.1 = Ä
:.2 = ö, shift-:.2 = Ö.
after pushing them to the device it is working like charm.
rooting the device is not an easy task tough
Sami
and the files attached in zip
Sami
and quick instructions on how to install:
1. your device needs to be rooted so that you can modify /system directory contents
2. get android sdk kit so that you can use adb:
root# adb devices
List of devices attached
SH16JRT03242 device
3. push modified files in place and reboot device
adb push vision-keypad-wwe.kl /system/usr/keylayout/vision-keypad-wwe.kl
adb push vision-keypad-wwe.kcm.bin /system/usr/keychars/vision-keypad-wwe.kcm.bin
Sami
You're my new favorite person, thank you <3
Sorry I'm bringing this rather old topic up again, but sketolas HW keyboard remap actually made me root my Desire Z in the first place.
So I have DZ with UK hardware keyboard and I just flashed it with Andromadus 10.1 CGmod 4.2.2. I'd like to now does this fix work on 4.2.2 or how would it be possible to remap those two shortcut keys to ä and ö? And to uppercase with shift.
I checked and the files are different in ICS/JB. They are both textfiles. Could anybody tell me what I have to change in vision-keypad-wwe.kl and vision-keypad-wwe.kcm to map a umlaut and o umlaut with user keys 1 and 2. And to get them uppercase with shift-button. Or is this possible at all?
OK, I got this sorted out.
Edited vision-keypad-wwe.kl and vision-keypad-wwe.kcm. It was pretty easy actually.
So if somebody wants to replace user-def keys in Desire Z hardware keyboard running 4.2.2 with Ä and Ö, push in the attached files and choose default keyboard in settings.

[Tutorial] Enable SoftKeys and Disable Soft Touch Keys

Requirements:
-Root
-ArtMod v5.1 http://forum.xda-developers.com/opt...om-e97520a-eu-4-4-2-artmodv3-0-te-10-t2811342
-SoftKey Enabler https://play.google.com/store/apps/details?id=com.fatedevgroup.softkeyenabler&hl=it
-A File Manager(for fixing taskmanager FC and modify keylayout)
-TaskManager Apk . (Link Below).
Steps:
- Go to settings and disable key illumination.
-With SoftKeyEnabler enable SoftKeys without rebooting..not necessary.
-To disable the hardware keys go to /system/usr/keylayout and modify keypad_8064.kl file by adding "#" on the last 3 lines.
Should look like this :
key 114 VOLUME_DOWN
key 115 VOLUME_UP
key 116 POWER WAKE
#key 139 MENU VIRTUAL
#key 158 BACK VIRTUAL
#key 172 HOME VIRTUAL
-To fix taskmanager FC you will have to download the app(link below) and copy it to system/app and fix permission.
-Enjoy.
ps: maybe there are better methods but this is the way i did it..
ps2: my first tutorial ..:good:
BUG : softkeys settings don't work..need for some one to fix. Not a big deal.Keys work fine without it.
Taskmanager link :
http://click.xda-developers.com/api...| Optimus G | XDA Forum&txt=LGTaskManager.apk
Sorin90 said:
Requirements:
-Root
-ArtMod v5.1 http://forum.xda-developers.com/opt...om-e97520a-eu-4-4-2-artmodv3-0-te-10-t2811342
-SoftKey Enabler https://play.google.com/store/apps/details?id=com.fatedevgroup.softkeyenabler&hl=it
-A File Manager(for fixing taskmanager FC and modify keylayout)
-TaskManager Apk . (Link Below).
Steps:
- Go to settings and disable key illumination.
-With SoftKeyEnabler enable SoftKeys without rebooting..not necessary.
-To disable the hardware keys go to /system/usr/keylayout and modify keypad_8064.kl file by adding "#" on the last 3 lines.
Should look like this :
key 114 VOLUME_DOWN
key 115 VOLUME_UP
key 116 POWER WAKE
#key 139 MENU VIRTUAL
#key 158 BACK VIRTUAL
#key 172 HOME VIRTUAL
-To fix taskmanager FC you will have to download the app(link below) and copy it to system/app and fix permission.
-Enjoy.
ps: maybe there are better methods but this is the way i did it..
ps2: my first tutorial ..:good:
BUG : softkeys settings don't work..need for some one to fix. Not a big deal.Keys work fine without it.
Taskmanager link :
http://click.xda-developers.com/api...| Optimus G | XDA Forum&txt=LGTaskManager.apk
Click to expand...
Click to collapse
man i have g2 headset which have 3 buttons but there is only play button can work so could you make work other buttons from g2 kernel??
Hmm i have no idea xD
Sent from my LG-E975 using XDA Free mobile app
The headset is probably one of the vendor things in /keylayout... dig around and report back in what you find!
hey there, nice trick if I wanted to disable a soft touch key in the bottom? I'm trying to insert # symbol in generic.kl file and external_kbd.kl at 139, 158 and 172 lines but doesn't work, any idea?
Gal3onn said:
hey there, nice trick if I wanted to disable a soft touch key in the bottom? I'm trying to insert # symbol in generic.kl file and external_kbd.kl at 139, 158 and 172 lines but doesn't work, any idea?
Click to expand...
Click to collapse
Did you reboot?
Sent from my LG-E975 using XDA Free mobile app
Of course
Sent from my LG-E975 using XDA Free mobile app
Awesome

Anyway to configure CEC remote commands from TV?

Hi
I love my firestick, it does so much more than what my previous raspberry pi (running kodi) could do. However one thing the pi could do was offer perfect CEC control via my TV's remote and one goal I have is to use a single (harmony) remote to control my entire AV setup.
The firestick does offer some level of CEC support but seems to vary hugely between different TVs, in my case on my Panasonic plasma tx-p42g30 I can only get the play/pause button to work (edit: the rewind, fast forward and stop buttons also work). So something is working but maybe not mapped properly?
Surely there must be somekind of file which can be edited to help map the CEC controls correctly? can anyone shed any light?
I had problems with a Panasonic TX-L37GN13 too.
CEC is called Viera-Cast on Panasonic TV's.
Perhaps we should create an topic in the developer board from amazon.
Where are you from? The US support should be much better then EU support.
Greetings by Idijt
I_did_it_just_tmrrow said:
I had problems with a Panasonic TX-L37GN13 too.
CEC is called Viera-Cast on Panasonic TV's.
Perhaps we should create an topic in the developer board from amazon.
Where are you from? The US support should be much better then EU support.
Greetings by Idijt
Click to expand...
Click to collapse
Whatever you think might get the ball rolling, it's one of those things before rooting was more accessible I'd assumed it'd be locked out feature to mod, but presumably with root it's a possibility now? I recall on the raspberry Pi i copied over a certain config file to enable additional buttons on my TV remote so hoping the same can be done.
I'm from the UK
My Panasonic XXX is currently not here.
Can you try to:
1. enable adb
2. open adb on a pc and type in
Code:
adb shell
or
Code:
adb shell
3. enable Panasonic's CEC and make sure you can use the less commands wich are usable
4a. type in shell
Code:
su
if you had root
4b. type in the shell
Code:
cat /proc/bus/input/devices
and tell us the output
5. There should be a line wich a named input, like input8 or input3.
6. type in the shell
Code:
cat THE_WHOLE_PATH_TO_THAT_INPUT_FILE
and tell us if he react if press on valid (working) buttons and non working buttons.
If there are some hieroglyphics with the non working buttons, we should be able to mention theese buttons in the right keyfiles.
Greetings by Idijt
I_did_it_just_tmrrow said:
I had problems with a Panasonic TX-L37GN13 too.
CEC is called Viera-Cast on Panasonic TV's.
Perhaps we should create an topic in the developer board from amazon.
Where are you from? The US support should be much better then EU support.
Greetings by Idijt
Click to expand...
Click to collapse
I_did_it_just_tmrrow said:
My Panasonic XXX is currently not here.
Can you try to:
1. enable adb
2. open adb on a pc and type in
Code:
adb shell
or
Code:
adb shell
3. enable Panasonic's CEC and make sure you can use the less commands wich are usable
4a. type in shell
Code:
su
if you had root
4b. type in the shell
Code:
cat /proc/bus/input/devices
and tell us the output
5. There should be a line wich a named input, like input8 or input3.
6. type in the shell
Code:
cat THE_WHOLE_PATH_TO_THAT_INPUT_FILE
and tell us if he react if press on valid (working) buttons and non working buttons.
If there are some hieroglyphics with the non working buttons, we should be able to mention theese buttons in the right keyfiles.
Greetings by Idijt
Click to expand...
Click to collapse
I've tried the commands via ADBfire and opening the adb shell - on 'su' I get a not found error (I don't have root)
On the 'cat /proc/bus/input/devices' command I get the following:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
godsakes said:
I've tried the commands via ADBfire and opening the adb shell - on 'su' I get a not found error (I don't have root)
On the 'cat /proc/bus/input/devices' command I get the following:
Click to expand...
Click to collapse
Why did you stop at Step 5?
Like I told you, do step 6,
Code:
cat /devices/virtual/input/input1
and tell us if he react if you press on valid (working) buttons and/or non working buttons.
If there are some hieroglyphics with the non working buttons, we should be able to mention theese buttons in the right keyfiles.
I can not check this before weekend.
Perhaps you dont have the right to "cat" the input1 without su/without root, but I think you should.
Greetings by Idijt
I_did_it_just_tmrrow said:
Why did you stop at Step 5?
Like I told you, do step 6,
Code:
cat /devices/virtual/input/input1
and tell us if he react if you press on valid (working) buttons and/or non working buttons.
If there are some hieroglyphics with the non working buttons, we should be able to mention theese buttons in the right keyfiles.
I can not check this before weekend.
Perhaps you dont have the right to "cat" the input1 without su/without root, but I think you should.
Greetings by Idijt
Click to expand...
Click to collapse
I'm afraid I get "no such file or directory" with that command...
Point me to the safest rooting guide and I'll give it a another try once rooted
godsakes said:
I'm afraid I get "no such file or directory" with that command...
Click to expand...
Click to collapse
Perhaps you need to mount the system partition to rw (read, write) and it is currently ro (read only).
To change this mount you need root but you should be able to read thethe read the input.
Please make again the first cat step and be sure, that you cat in the next step the right input + path from the amazon-cec device.
Perhaps the inputs are connected to devices on device startup.
godsakes said:
Point me to the safest rooting guide and I'll give it a another try once rooted
Click to expand...
Click to collapse
Point youself to the, perhaps availible, right rooting method or guide. Sorry but this is your device, you know your current stock FW and this is not the thread topic.
I own a stick with root, but hardware rooted with emmc adapter. If you life in germany or a neighbour country I can help you.
I hope we can leave this topic by its own topic
It really could be possible to add some keys from the tv remote.
Greetings by Idijt
Ok, I've since used king root to root the stick
Now when i type 'SU' the command line does indicate the user (if that's the right word?) is root
But I still get the same error... could you just double check I've done the right commands
Your commands seems to be right. I am not the 100% Linux pro but I am 80% sure that I do that on this way with a Xiaomi Bluetooth Controller.
Can list the area's?
Code:
su
ls /devices/
ls /devices/virtual/
ls /devices/virtual/input/
Each line after the other.
If that not work, tell us. You can check this too with another Input and device. Did you got always that error?
ByTheWay: you can just Copy the Text out of the shell/adb and put them here into a Code Block. This also very nice for people who are searching for some words.
Any other here who can help us?
Greetings by Idijt
I_did_it_just_tmrrow said:
Your commands seems to be right. I am not the 100% Linux pro but I am 80% sure that I do that on this way with a Xiaomi Bluetooth Controller.
Can list the area's?
Code:
su
ls /devices/
ls /devices/virtual/
ls /devices/virtual/input/
Each line after the other.
If that not work, tell us. You can check this too with another Input and device. Did you got always that error?
ByTheWay: you can just Copy the Text out of the shell/adb and put them here into a Code Block. This also very nice for people who are searching for some words.
Any other here who can help us?
Greetings by Idijt
Click to expand...
Click to collapse
same error with all 3 of those commands, I've tried a couple of variations of the previous step but again same error
Code:
[email protected]:/ $ su
su
[email protected]:/ # ls /devices/
ls /devices/
/devices/: No such file or directory
1|[email protected]:/ # ls /devices/virtual/
ls /devices/virtual/
/devices/virtual/: No such file or directory
1|[email protected]:/ # ls /devices/virtual/input/
ls /devices/virtual/input/
/devices/virtual/input/: No such file or directory
1|[email protected]:/ # cat /proc/bus/input/devices
cat /proc/bus/input/devices
I: Bus=0005 Vendor=0000 Product=0000 Version=0008
N: Name="amazon_touch"
P: Phys=
S: Sysfs=/devices/virtual/input/input0
U: Uniq=
H: Handlers=event0
B: PROP=0
B: EV=b
B: KEY=400 0 0 0 0 0 0 0 0 0 0
B: ABS=2650000 1000000
I: Bus=0003 Vendor=0000 Product=0000 Version=0001
N: Name="amazon-cec"
P: Phys=
S: Sysfs=/devices/virtual/input/input1
U: Uniq=
H: Handlers=kbd event1
B: PROP=0
B: EV=3
B: KEY=3ff 0 0 400000 2fc000 c3060 0 0 0 10004 210000 192 40000c01 9e3781 0 8010
0000 10000002
I: Bus=0005 Vendor=0000 Product=0000 Version=0008
N: Name="kcmouse"
P: Phys=
S: Sysfs=/devices/virtual/input/input2
U: Uniq=
H: Handlers=mouse0 event2
B: PROP=0
B: EV=7
B: KEY=70000 0 0 0 0 0 0 0 0
B: REL=103
[email protected]:/ # cat /devices/virtual/input/input2
cat /devices/virtual/input/input2
tmp-mksh: cat: /devices/virtual/input/input2: No such file or directory
1|[email protected]:/ # cat devices/virtual/input/input1
cat devices/virtual/input/input1
tmp-mksh: cat: devices/virtual/input/input1: No such file or directory
1|[email protected]:/ # cat //devices/virtual/input/input1
cat //devices/virtual/input/input1
tmp-mksh: cat: //devices/virtual/input/input1: No such file or directory
1|[email protected]:/ #
All u have here is
[email protected]:/ # ls -la /sys/devices/virtual/input/input1/
drwxr-xr-x root root 2016-06-23 22:39 capabilities
drwxr-xr-x root root 2016-06-23 22:39 event1
drwxr-xr-x root root 2016-06-23 22:39 id
-r--r--r-- root root 4096 2016-06-23 22:39 modalias
-r--r--r-- root root 4096 2016-06-23 22:39 name
-r--r--r-- root root 4096 2016-06-23 22:39 phys
drwxr-xr-x root root 2016-06-23 22:39 power
-r--r--r-- root root 4096 2016-06-23 22:39 properties
lrwxrwxrwx root root 2016-06-23 22:39 subsystem -> ../../../../class/input
-rw-r--r-- root root 4096 2016-06-23 22:39 uevent
-r--r--r-- root root 4096 2016-06-23 22:39 uniq
BTW.
I've also got hard times with CEC with my sammy 40c650 . Only FF and REW are recogized by AFTS .
There is clear visibility on triggered events but no visibility on direct input (lack of tool)
[email protected]:/ # getevent -li /dev/input/event1
Can't enable monotonic clock reporting: Invalid argument
add device 1: /dev/input/event1
bus: 0003
vendor 0000
product 0000
version 0001
name: "amazon-cec"
location: ""
id: ""
version: 1.0.1
events:
KEY (0001): KEY_ESC KEY_ENTER KEY_DOT KEY_F5
KEY_KPENTER KEY_UP KEY_PAGEUP KEY_LEFT
KEY_RIGHT KEY_DOWN KEY_PAGEDOWN KEY_MUTE
KEY_VOLUMEDOWN KEY_VOLUMEUP KEY_POWER KEY_PAUSE
KEY_STOP KEY_HELP KEY_MENU KEY_BACK
KEY_EJECTCD KEY_PLAYPAUSE KEY_RECORD KEY_REWIND
KEY_FASTFORWARD KEY_SOUND KEY_MEDIA KEY_UNKNOWN
KEY_OPTION* KEY_INFO KEY_FAVORITES KEY_EPG
KEY_SUBTITLE KEY_ANGLE KEY_RED KEY_GREEN
KEY_YELLOW KEY_BLUE KEY_CHANNELUP KEY_CHANNELDOWN
KEY_LAST KEY_CONTEXT_MENU KEY_NUMERIC_0 KEY_NUMERIC_1
KEY_NUMERIC_2 KEY_NUMERIC_3 KEY_NUMERIC_4 KEY_NUMERIC_5
KEY_NUMERIC_6 KEY_NUMERIC_7 KEY_NUMERIC_8 KEY_NUMERIC_9
input props:
<none>
Output on button pressing (only FF and REW give out anything)
[email protected]:/ # getevent -l /dev/input/event1
Can't enable monotonic clock reporting: Invalid argument
EV_KEY KEY_REWIND DOWN
EV_SYN SYN_REPORT 00000000
EV_KEY KEY_REWIND UP
EV_SYN SYN_REPORT 00000000
EV_KEY KEY_FASTFORWARD DOWN
EV_SYN SYN_REPORT 00000000
EV_KEY KEY_FASTFORWARD UP
EV_SYN SYN_REPORT 00000000
The correct input device for cec on your FireStick is: /dev/input/event1.
If you want to change the behavior of your remote keys you can create a file named amazon-cec.kl under: /system/usr/keylayout.
However, don't know how this is on the FireTV and FireTV2. On the FireTV2 i don't get any responses using getevent and evtest and i dont own a FireTv Gen 1.
Edit:
Haven't seen the last post. Try using evtest on /dev/input/event1. It shows you the keycodes so you can assign them in the layout file.
for my old tv it would look like this:
Code:
# Copyright (C) 2010 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.
# Custom Keylayout for Sony Bravia KDL-*EX72* cec function on FireStick
# NOTE
# This mainly mapps menu to the options button and home to the home button,
# additionaly we assign keys to the special buttons (red, blue, info etc.).
# To make our life easier we just assign F1-F7 to those keys.
# Comments contain original values as per evtest /dev/input/event1
# NOTE: F1-F7 seem to not get passed to Kodi!? As Workaround we use A-F
key 96 DPAD_CENTER #KPEnter (Real Enter)
key 103 DPAD_UP #Up
key 105 DPAD_LEFT #Left
key 106 DPAD_RIGHT #Right
key 108 DPAD_DOWN #Down
key 128 MEDIA_STOP #Stop
key 139 HOME WAKE_DROPPED #Menu
key 158 BACK WAKE_DROPPED #Back
key 164 MEDIA_PLAY_PAUSE #PlayPause
key 168 MEDIA_REWIND #Rewind
key 208 MEDIA_FAST_FORWARD #Fast Forward
key 357 MENU #Option
key 358 F #Info - KEY_INFO
key 365 E #EPG - KEY_EPG
#key 370 SUBTITLE #Subtitle - KEY_SUBTITLE
key 398 A #Red Button - KEY_RED
key 399 B #Green Button - KEY_GREEN
key 400 C #Yellow Button - KEY_YELLOW
key 401 D #Blue Button - KEY_BLUE
key 402 PAGE_UP #Channel Up
key 403 PAGE_DOWN #Channel Down
key 512 0 #Numeric 0
key 513 1 #Numeric 1
key 514 2 #Numeric 2
key 515 3 #Numeric 3
key 516 4 #Numeric 4
key 517 5 #Numeric 5
key 518 6 #Numeric 6
key 519 7 #Numeric 7
key 520 8 #Numeric 8
key 521 9 #Numeric 9
Reading the above 2 posts and using the command 'getevent -1 /dev/input/event1'
I can get some reporting - but only for the buttons already recognised (play, rewind, fastforward, stop), I also have a play/pause button on my remote but it's recognised as the same command as the play button
Code:
[email protected]:/ $ su
su
[email protected]:/ # getevent -l /dev/input/event1
getevent -l /dev/input/event1
Can't enable monotonic clock reporting: Invalid argument
EV_KEY KEY_PLAYPAUSE DOWN
EV_SYN SYN_REPORT 00000000
EV_KEY KEY_PLAYPAUSE UP
EV_SYN SYN_REPORT 00000000
EV_KEY KEY_REWIND DOWN
EV_SYN SYN_REPORT 00000000
EV_KEY KEY_REWIND UP
EV_SYN SYN_REPORT 00000000
EV_KEY KEY_STOP DOWN
EV_SYN SYN_REPORT 00000000
EV_KEY KEY_STOP UP
EV_SYN SYN_REPORT 00000000
EV_KEY KEY_FASTFORWARD DOWN
EV_SYN SYN_REPORT 00000000
EV_KEY KEY_FASTFORWARD UP
EV_SYN SYN_REPORT 00000000
Try using evtest and look if the keycodes are indentical or not and remap them how you like.
I dont recommend using getevent for other use than getting the correct input device. If you press some button it only shows some kind of default value for the keyevent reported from your input device.
If you use evtest on /dev/input/event1 you can see what i mean by looking at the top of the output.
@WheelchairArtist done & done
[email protected]:/ # evtest /dev/input/event1
Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0x0 product 0x0 version 0x1
Input device name: "amazon-cec"
Supported events:
Event type 0 (Sync)
Event type 1 (Key)
Event code 1 (Esc)
Event code 28 (Enter)
Event code 52 (Dot)
Event code 63 (F5)
Event code 96 (KPEnter)
Event code 103 (Up)
Event code 104 (PageUp)
Event code 105 (Left)
Event code 106 (Right)
Event code 108 (Down)
Event code 109 (PageDown)
Event code 113 (Mute)
Event code 114 (VolumeDown)
Event code 115 (VolumeUp)
Event code 116 (Power)
Event code 119 (Pause)
Event code 128 (Stop)
Event code 138 (Help)
Event code 139 (Menu)
Event code 158 (Back)
Event code 161 (EjectCD)
Event code 164 (PlayPause)
Event code 167 (Record)
Event code 168 (Rewind)
Event code 208 (Fast Forward)
Event code 213 (Sound)
Event code 226 (Media)
Event code 240 (Unknown)
Event code 357 (Option)
Event code 358 (Info)
Event code 364 (Favorites)
Event code 365 (EPG)
Event code 370 (Subtitle)
Event code 371 (Angle)
Event code 398 (Red)
Event code 399 (Green)
Event code 400 (Yellow)
Event code 401 (Blue)
Event code 402 (ChannelUp)
Event code 403 (ChannelDown)
Event code 405 (Last)
Event code 438 (?)
Event code 512 (?)
Event code 513 (?)
Event code 514 (?)
Event code 515 (?)
Event code 516 (?)
Event code 517 (?)
Event code 518 (?)
Event code 519 (?)
Event code 520 (?)
Event code 521 (?)
Testing ... (interrupt to exit)
Event: time 452.538264, type 1 (Key), code 139 (Menu), value 0
Event: time 452.538274, -------------- Report Sync ------------
Event: time 462.140498, type 1 (Key), code 139 (Menu), value 1
Event: time 462.140507, -------------- Report Sync ------------
Event: time 478.609635, type 1 (Key), code 357 (Option), value 0
Event: time 478.609643, -------------- Report Sync ------------
Event: time 490.073024, type 1 (Key), code 357 (Option), value 1
Event: time 490.073032, -------------- Report Sync ------------
Event: time 503.634929, type 1 (Key), code 357 (Option), value 0
Event: time 503.634937, -------------- Report Sync ------------
Event: time 513.041136, type 1 (Key), code 168 (Rewind), value 1
Event: time 513.041146, -------------- Report Sync ------------
Event: time 513.260947, type 1 (Key), code 168 (Rewind), value 0
Event: time 513.260955, -------------- Report Sync ------------
Event: time 514.352655, type 1 (Key), code 208 (Fast Forward), value 1
Event: time 514.352663, -------------- Report Sync ------------
Event: time 514.576434, type 1 (Key), code 208 (Fast Forward), value 0
Event: time 514.576442, -------------- Report Sync ------------
there is no amazon-cec.kl under /system/usr/keylayout/ (also tested all in https://source.android.com/devices/input/key-layout-files.html) . I've downloaded Sony Bravia amazon-cec ,rebooted and nothing changed . Also creating Vendor_0000_Product_0000_Version_0001.kl keylayout (same as detected device ) give nothing ... no new button recognized ever .
Did u gave the amazon-cec file the right permissions and set the right owner? Also make sure to not forget the .kl at the end.
Also in my file the buttons u pressed (as seen in your post) are mapped the exact same way.
You could try to switch keycodes 139 and 208 to see if the layout file works.
Just for the record, today i updated my amazon-cec.kl file because it didn't work with my new stick on android 5, maybe that was your problem with my file?
If you still need/want to remap the buttons here is the new file (removed depracted WAKE_DROPPED flag and remapped Subtitle to G):
Code:
# Copyright (C) 2010 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.
# Custom Keylayout for Sony Bravia KDL-*EX72* cec function on FireStick
# NOTE
# This mainly mapps menu to the options button and home to the home button,
# additionaly we assign keys to the special buttons (red, blue, info etc.).
# To make our life easier we just assign F1-F8 to those keys.
# Comments contain original values as per evtest /dev/input/event1
# NOTE: F1-F8 seem to not get passed to Kodi!? As Workaround we use A-G
key 96 DPAD_CENTER #KPEnter (Real Enter)
key 103 DPAD_UP #Up
key 105 DPAD_LEFT #Left
key 106 DPAD_RIGHT #Right
key 108 DPAD_DOWN #Down
key 128 MEDIA_STOP #Stop
key 139 HOME #Menu
key 158 BACK #Back
key 164 MEDIA_PLAY_PAUSE #PlayPause
key 208 MEDIA_REWIND #Rewind
key 168 MEDIA_FAST_FORWARD #Fast Forward
key 357 MENU #Option
key 358 F #Info - KEY_INFO
key 365 E #EPG - KEY_EPG
key 370 G #Subtitle - KEY_SUBTITLE
key 398 A #Red Button - KEY_RED
key 399 B #Green Button - KEY_GREEN
key 400 C #Yellow Button - KEY_YELLOW
key 401 D #Blue Button - KEY_BLUE
key 402 PAGE_UP #Channel Up
key 403 PAGE_DOWN #Channel Down
key 512 0 #Numeric 0
key 513 1 #Numeric 1
key 514 2 #Numeric 2
key 515 3 #Numeric 3
key 516 4 #Numeric 4
key 517 5 #Numeric 5
key 518 6 #Numeric 6
key 519 7 #Numeric 7
key 520 8 #Numeric 8
key 521 9 #Numeric 9
I switched the Rewind and FastForward buttons so you can check if it gets accepted.
You could also check logcat for any hints:
Code:
logcat | grep amazon-cec

mapping keys (recentapps, application) in keyboard layout file

I am trying to map the recent apps and applications key on samsung bluetooth keyboard to teh recnet apps and apps buttons, just like the app_switch capactive button. The Home button and back button the the physical keyboard already work. Following the below guide, one would modify /system/usr/keylayout/Generic.kl with relevant scan codes
Code:
#http://www.thriveforums.org/forum/toshiba-thrive-development/9626-how-create-customized-keylayout-any-usb-bluetooth-keyboard-rooted.html
#/system/usr/keylayout/Generic.kl
key 704 RECENTAPPS
key 705 APPLICATION
and save the file as /system/usr/keylayout/Vendor_04e8_Product_a006.kl, where the keyboard's vendor and product id are found by
Code:
cat /proc/bus/input/devices
; on my device this gets the following
I: Bus=0005 Vendor=04e8 Product=a006 Version=0001
N: Name="Samsung Bluetooth Keyboard EJ-CT800"
P: Phys=
S: Sysfs=/devices/virtual/misc/uhid/input11
U: Uniq=
H: Handlers=sysrq event11 sec_debug
B: PROP=0
B: EV=12001b
B: KEY=147 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10003 2010007 ff9f317a c14057ff febeffdf ffefffff ffffffff fffffffe
B: ABS=ffffff00 0
B: MSC=10
B: LED=1f
However, this does not work; niether does copying the appropriate keylayout file Vendor_04e8_Product_a006.kl directly from samsung stock rom, which shows the key scancoes above. Instead, it seems some people got it working by changing the source code related to whievever key code you desire and compile android.policy.jar ike this:
evilisto said:
platform/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
from :
Code:
} else if (keyCode == KeyEvent.KEYCODE_APP_SWITCH) {
if (down && repeatCount == 0) {
showOrHideRecentAppsDialog(RECENT_APPS_BEHAVIOR_SHOW_OR_DISMISS);
}
return -1;
}
to :
Code:
} else if (keyCode == KeyEvent.KEYCODE_APP_SWITCH) {
if (down && repeatCount == 0 && !keyguardOn) {
try {
mStatusBarService.toggleRecentApps();
} catch (RemoteException e) {
Slog.e(TAG, "RemoteException when showing recent apps", e);
}
}
return -1;
}
Click to expand...
Click to collapse
It seems simple enough, but i am not compilng yet; it would be useful to have this for cm roms, but not sure about compatibility with different rom versions (i.e., cm-11, 12, 13, 14); if someone builds this, perhaps comment on this... thanks
would someone like to compile this and try, as i'm sure a lot of people have this keyboard? :laugh:
err, found my error with the recentapps button; making it app_switch instead of recentapps makes it work, so it only remains to make the application button, which opens the app drawer. i ohpe this interests somebody, but if not whatever
I have the same issue. I guess it's a rom compatibility thing. My Samsung Bluetooth keyboard works fine except for recent apps key (F2) then F3 and F4 don't work as in when you hit those keys, nothing happens at all. I hope we can find a workaround for this.
Same issue here as well.
I am using as well the Original keyboard of tab s (EC-JT800) with aicp ROM 7.1. (preatty good i would say) but there are several issues with the hardware keyboard like:
change between 2-3 languages (no keyboard mapping)
app switching (F2) and app drawer (F3) buttons are not working
caps lock light not turn on
lang does nothing
etc.
I have tried another ROM which is based on the samsung stock firmware: IronRom V3.2 ( https://forum.xda-developers.com/galaxy-tab-s/development/prerooted-stock-touchwiz-rom-t2973107) and i noticed that the keyboard is fully working as expected. Therefore i assume that the keyboard layout is the original from samsung incorporated into the ROM. If we copy this layout it will work on a 7.* ROM version ?
Update: Searching inside the above mentioned ROM i found the file Vendor_04e8_Product_a006.kl which i am planning to copy over. The thing is that the system filesystem is read only.
Any Idea ?
---------- Post added at 15:07 ---------- Previous post was at 14:33 ----------
I research and it seems that ssome of the mapping missings are :
key 368 LANG
# F2 F3 F4
key 704 RECENTAPPS
key 705 APPLICATION
key 706 SIP_ON_OFF
# LEDs
led 0x01 CAPS_LOCK
Will copy the file over from the other ROM and update about the results.
I'm trying to do the same here, with Lineage OS on an SM-T800.
As already said, the stock keylayout, which includes something like this:
Code:
key 704 RECENTAPPS
key 705 APPLICATION
key 706 SIP_ON_OFF
key 707 VOICESEARCH
key 708 QPANEL_ON_OFF
key 710 SFINDER
key 712 MULTI_WINDOW
does not work on non-stock ROMs. I can also verify that setting scancode 704 to keycode APP_SWITCH, does work.
Indeed, these keycodes (RECENTAPPS, etc) are not mentioned in the KeyEvent android developers page, nor can I find a substitute for the missing ones.
For the language switch, I tried running inside an adb shell the command
Code:
input keyevent LANGUAGE_SWITCH
and sure enough, I was able to switch language on my keyboard.
I then checked to see what is emitted when I press the "LANG" key on the keyboard, and it seems that it's just SHIFT+SPACE. So I went ahead and defined a keychar file (/system/user/keychars/Vendor_04e8_Product_a006.kcm) where I asked for Shift+Space to send the LANGUAGE_SWITCH keycode. No luck
As a temporary solution, I've mapped the "keyboard" key (just right of the Function key) to LANGUAGE_SWITCH, and that is working fine.
So my keylayout for now includes:
Code:
key 704 APP_SWITCH
key 706 LANGUAGE_SWITCH
Last (but not least), I have no clue how to drive the led for caps-lock. I tried all led numbers from 0x00 to 0x1f in the keylayout file, nothing seems to be doing the trick. I also cannot find any proper documentation on that, to understand how it works.
I'll keep digging. I really don't get why the key character map file didn't work for setting the language. At least that part should be feasible.
Quite strange.
I have installed the IronRom V3.2 (https://forum.xda-developers.com/galaxy-tab-s/development/prerooted-stock-touchwiz-rom-t297310 ) and the keyboard layout is working fine !!! Functions keys, language key and the caps lock led are all working. Keep in mind that this ROM is based on stock and is running android 6.0.1
I wonder if a copy of the files /system/user/keychars/* to a newer android version might work. I also noticed on other nougat versions (AICP, LIneage) that the keyboard settings are completely different that Marshmallow.
ale_kons said:
Quite strange.
I have installed the IronRom V3.2 (https://forum.xda-developers.com/galaxy-tab-s/development/prerooted-stock-touchwiz-rom-t297310 ) and the keyboard layout is working fine !!! Functions keys, language key and the caps lock led are all working. Keep in mind that this ROM is based on stock and is running android 6.0.1
I wonder if a copy of the files /system/user/keychars/* to a newer android version might work. I also noticed on other nougat versions (AICP, LIneage) that the keyboard settings are completely different that Marshmallow.
Click to expand...
Click to collapse
Your link seems to be wrong.
If this ROM is based on samsung stock, then my guess would be that this is what makes it work with the keyboard, not necessarily the android version. Did you use the ROM with the stock kernel or the "ironstock" kernel?
I guess I have the stock kernel, have to check though
My kernel version is: 3.4.113-IronStock_SM-T800_V3.2
Current ROM: IronRom V3.2_T800
As mentioned above the keyboard is working as it was supposed too.

Modifying System Files to Add a Key Layout File

Greetings Everyone,
Device: OnePlus 7T
Goal: To create a new Key Layout File (.kl) in /system/usr/keylayout for my Xbox Elite 2 Controller. Currently its using the Generic key layout file since its product ID doesn't have a matching key layout file. This maps the double square button to "back" and really interferes with the gameplay (Destiny 2 on Stadia, can't summon sparrow or ghost and can't access the director).
I have the vendor and product ID's of the new controller, the only issue is adding the new key layout file into the keylayout directory. I can't get past the read only issue in that folder. I do have root via magisk. I've tried renaming files in the folder locally using Root Explorer and pushing via adb (read only and dm-verity issues occur). Neither work. I can't remount to make the system writable either(due to the verity issues).
Weird thing that happened, I modified a similar key layout file (same vendor ID but different product ID) in that same directory and the modification stuck. For some reason the read only restrictions were lifted briefly somehow. Can't really explain why that happened. Opened via Gamepad Tester app, modified the contents, told it to save and it saved. If I could recreate that somehow to rename the file I modified to the correct product ID, I'd be golden, but the read only restrictions have everything locked back down.
If anyone has some pro tips, I'd be very very thankful. I have been working on this for over 6 hours to no avail.
Thanks again for your potential and extremely appreciated help!
Modifying system is no go, your best shot is to create a magisk module.
Maybe this might be something you're interested in.
https://forum.xda-developers.com/apps/magisk/module-1controller-1-module-to-support-t3865889
If the layout isn't there, you could try asking the OP or adding the .kl here and zip the module up.
https://github.com/Magisk-Modules-Repo/OneController/tree/master/system/usr/keylayout
(Note: I have no idea if this magisk module uses an up to date template)
Lossyx said:
Modifying system is no go, your best shot is to create a magisk module.
Maybe this might be something you're interested in.
https://forum.xda-developers.com/apps/magisk/module-1controller-1-module-to-support-t3865889
If the layout isn't there, you could try asking the OP or adding the .kl here and zip the module up.
https://github.com/Magisk-Modules-Repo/OneController/tree/master/system/usr/keylayout
(Note: I have no idea if this magisk module uses an up to date template)
Click to expand...
Click to collapse
Thanks for the reply Lossyx!
Those links are very promising. The layout is not in one of those listed. I had already created the layout I need to test out. About to go to bed soon(night shift this weekend) but I'll figure out how to make the module with the updated layout and I'll post my results later.
Pretty excited to try it out! Thanks again.
Well Lossyx, you sir are a genius!
The Majisk Module you linked above worked! I removed all the keylayout files in the original module, added my new layout for the Xbox Elite 2 Controller, updated the update-binary, zipped and flashed. Every button now works as expected. Only issue, if you want to call it that, when I look at the modules in Majisk, it just shows info not provided for the new module. I updated the module.prop file to reflect the new changes but its not being read for some reason. Like I said, not really an issue since it works.
Recap for anyone interested: The goal was to use my Xbox Elite 2 Wireless controller on my OnePlus 7T to play Destiny 2 on Stadia.
-I rooted by booting with TWRP via ADB to get the boot.img. Used Magisk Canary to patch this image and flashed the new image to boot.
-Once rooted, I used the MajiskHide Props Config to create new props to make Apps think "Pixel 4" was the model and manufacturer was "Google" (required to load Stadia on phone as Stadia is currently restricted to Pixel 4 and Pixel 3, although it runs great with the new props on the OnePlus 7T).
-Thanks to Lossyx, I updated https://forum.xda-developers.com/apps/magisk/module-1controller-1-module-to-support-t3865889 OneController to add the new kaylayout file for the Xbox Elite 2 Controller. Deleted all other keylayouts in that module, added the new layout, updated update-binary, zipped then flashed.
If anyone has any questions about what I did, please let me know and I'll help as much as my limited experience allows. Thanks again to Lossyx, couldn't have don't it without him!!!!
New KeyLayout info: file name = Vendor_045e_Product_0b05.kl
In the file:
# Copyright (C) 2019 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 Elite Wireless Controller - Elite 2 - Bluetooth
#
# Mapping according to https://developer.android.com/training/game-controllers/controller-input.html
key 304 BUTTON_A
key 305 BUTTON_B
key 307 BUTTON_X
key 308 BUTTON_Y
key 310 BUTTON_L1
key 311 BUTTON_R1
# Triggers.
axis 0x0a LTRIGGER
axis 0x09 RTRIGGER
# 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 0x02 Z flat 4096
axis 0x05 RZ flat 4096
key 317 BUTTON_THUMBL
key 318 BUTTON_THUMBR
# Hat.
axis 0x10 HAT_X
axis 0x11 HAT_Y
# Mapping according to https://www.kernel.org/doc/Documentation/input/gamepad.txt
# Two overlapping rectangles
key 158 BUTTON_SELECT
# Hamburger - 3 parallel lines
key 315 BUTTON_START
# Xbox key
key 316 BUTTON_MODE
I have the same Devices 7T/Elite2, the same problems and now they belong to the past. Damn Boy, it worked!
THATS why i love XDA
Would you mind helping me out? I'm sure this is a silly question, but what did you mean by "updated update-binary"? I see the file that you're talking about in the Magisk Module, but what exactly am I updating in that file?
alc8traz said:
Well Lossyx, you sir are a genius!
The Majisk Module you linked above worked! I removed all the keylayout files in the original module, added my new layout for the Xbox Elite 2 Controller, updated the update-binary, zipped and flashed. Every button now works as expected. Only issue, if you want to call it that, when I look at the modules in Majisk, it just shows info not provided for the new module. I updated the module.prop file to reflect the new changes but its not being read for some reason. Like I said, not really an issue since it works.
Recap for anyone interested: The goal was to use my Xbox Elite 2 Wireless controller on my OnePlus 7T to play Destiny 2 on Stadia.
-I rooted by booting with TWRP via ADB to get the boot.img. Used Magisk Canary to patch this image and flashed the new image to boot.
-Once rooted, I used the MajiskHide Props Config to create new props to make Apps think "Pixel 4" was the model and manufacturer was "Google" (required to load Stadia on phone as Stadia is currently restricted to Pixel 4 and Pixel 3, although it runs great with the new props on the OnePlus 7T).
-Thanks to Lossyx, I updated https://forum.xda-developers.com/apps/magisk/module-1controller-1-module-to-support-t3865889 OneController to add the new kaylayout file for the Xbox Elite 2 Controller. Deleted all other keylayouts in that module, added the new layout, updated update-binary, zipped then flashed.
If anyone has any questions about what I did, please let me know and I'll help as much as my limited experience allows. Thanks again to Lossyx, couldn't have don't it without him!!!!
New KeyLayout info: file name = Vendor_045e_Product_0b05.kl
In the file:
# Copyright (C) 2019 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 Elite Wireless Controller - Elite 2 - Bluetooth
#
# Mapping according to https://developer.android.com/training/game-controllers/controller-input.html
key 304 BUTTON_A
key 305 BUTTON_B
key 307 BUTTON_X
key 308 BUTTON_Y
key 310 BUTTON_L1
key 311 BUTTON_R1
# Triggers.
axis 0x0a LTRIGGER
axis 0x09 RTRIGGER
# 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 0x02 Z flat 4096
axis 0x05 RZ flat 4096
key 317 BUTTON_THUMBL
key 318 BUTTON_THUMBR
# Hat.
axis 0x10 HAT_X
axis 0x11 HAT_Y
# Mapping according to https://www.kernel.org/doc/Documentation/input/gamepad.txt
# Two overlapping rectangles
key 158 BUTTON_SELECT
# Hamburger - 3 parallel lines
key 315 BUTTON_START
# Xbox key
key 316 BUTTON_MODE
Click to expand...
Click to collapse

Categories

Resources