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.
Related
Can anyone help me remap the home key so it opens VC 1.6. Right now when I press it it opens voice speed dial not VC 1.6.
ch8 said:
Can anyone help me remap the home key so it opens VC 1.6. Right now when I press it it opens voice speed dial not VC 1.6.
Click to expand...
Click to collapse
Which ROM are you running on your device.....?
I am running the rogers WM6 rom
Remap
ch8 said:
I am running the rogers WM6 rom
Click to expand...
Click to collapse
Try to find this download {eT9 Excalibur.0409.Kmap}, I believe this is what you need! Just copy to the Windows folder..................!
Thanks I did d/l the file but I have no idea how to make voice command launch since they are using program codes here.
//
// N O T E: This file must be saved as Unicode
//
// This file contains the virtual keys mapping table for the
// Excalibur device. The mapping table is define as follow
//
// VK_TPOUND = 0x78
// VK_TSTAR = 0x77
// VK_TAB = 0x09
//
// We do not support escape value yet. So the key/char values should be
// entered explicitly or by encoding start with 0x
//
// Format:
// {VK VK' CH1 CH2}
// VK -> value from keyboard driver
// VK' -> printed on keys
// CH1 -> symbols produced by Fn + key
// CH2 -> symbols in 123 mode
// KeyIndex -> matched the kdb key index, 0xff -> no key index
{Q Q % % 0x00}
{1 W 1 1 0x01}
{2 E 2 2 0x02}
{3 R 3 3 0x03}
{T T + + 0x04}
{Y Y ( ( 0x05}
{U U ) ) 0x06}
{I I - - 0x07}
{O O _ _ 0x08}
{P P " " 0x09}
{0x78 A # # 0x0a} // VK_TPOUND maps to Device Button A
{4 S 4 4 0x0b}
{5 D 5 5 0x0c}
{6 F 6 6 0x0d}
{G G / / 0x0e}
{H H ? ? 0x0f}
{J J @ @ 0x10}
{K K $ $ 0x11}
{L L = = 0x12}
{0x77 Z * * 0x13} // VK_TSTAR maps to Z
{7 X 7 7 0x14}
{8 C 8 8 0x15}
{9 V 9 9 0x16}
{B B ' ' 0x17}
{N N & & 0x18}
{M M ! ! 0x19}
{0xBC , ; ; 0xff} // 0xBC = VK_COMMA
{0xBE . : : 0xff} // 0xBE = VK_PERIOD
{0 0x09 0 0 0xff} // 0x30 = VK_TAB
{0xE9 0xE9 0xC1 0xC1 0xff} // Launch Camera with Fn
Copy To The Windows Folder
Copy the download to the Windows folder,don't take the download out of the package leave the download in the package, just copy it to the Windows folder, soft reset the device.
Actually, this is an interesting topic in itself, i.e. remapping the long-press (aka. press-and-hold) functionality of the HOME key. For example, I'd like to change it to be something completely different (perhaps the VITO AudioNotes recorder, for example), and it doesn't look like this can be achieved from fiddling with the keymap (kmap) file.
On the some smartphones, the long press of the HOME key can be tweaked by simply replacing the default application that gets loaded by tweaking the appropriate registry key. For example, on the Motorola Q, the long-press of the HOME key brings up the quickapp.exe (i.e. the "quick list" that seems to come up on my T-Mobile Dash w/WM6 when I quickly press the Power button). So, if I had a Motorola Q, all I'd need to do was go to:
HKEY_LOCAL_MACHINE\Software\Microsoft\Shell\Rai\:MSQuickApp\1
and replace quickapp.exe with something else.
I just can't figure out the right place to tweak things for my Dash. All I know is that now when I press-and-hold the HOME key it brings up the Voice Recorder. I can't even find where the Voice Recorder program is stored... it's link file (.lnk) in the Start Menu contains:
22#:MSTNOTES?:notesapp
And I can't seem to find any reference to notesapp (either in the \Windows directory -- e.g. no notesapp.exe or notesapp.lnk, nor in the registry).
My only hint was to look under HKLM\Software\Microsoft\Shell\Rai\:MSTNOTES
but there I found that it was referencing ":MSPOUTLOOK notes"... Another mystery to me. It feels like I'm going through magic rabbit holes like Alice in Wonderland, that lead to nowhere...
Anyone with some further insights on this?
Remap Home key for Voice Command
Will the above keymap change the rest of my keys? I don't know how to read those things, so I can't just create my own keymap by changing that one line.
For me holding the Home key launches Voice Command. Do you have App3 selected as the voice Button? Do you have voice command enabled. I am using an s621 with the Rogers WM6 ROM.
Hello, I use my HTC to connect to Linux based machines.
Unfortunately the keyboard is missing a few things.
I would like to know if it is possible to extend the keymapping of the FN+[KEY] to add new keys?
For an example of the mappings I would like:
FN+[KEY] = [KEY]:
Q = {
W = }
A = [
S = ]
D = <
F = >
Z = |
X = \
T = TAB
Y = ESC
C = `
V = HOME
B = END
G = ~
Is that possible?
http://forum.xda-developers.com/showthread.php?t=554240
yay yay YAY YAY yay yay yay!
Perhaps I should test it first though.
That key remapper works great. But I don't see a lot of the symbols you want listed as possible options in the remapper. But maybe they can be entered manually.
The key mapper wont work, however it might if I upgrade to 6.5. Unfortunately, I cannot find any way to perform a full backup of the device's memory.
Edit: I've tried with 6.5 and no luck. I've moved my enquiry to the keymapper thread (took some hardcore google usage to find that) as that looks best.
Thanks.
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
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?
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