[Workaround] [Howto] Using the left button on Elephone P9000, CM13, Deepflex - Elephone P9000 Guides, News, & Discussion

You need root access and "Buttons remapper" from Playstore.
- move to '/system/usr/keylayout' and edit 'mtk-kpd.kl'
- at the bottom of the file insert a line 'key 250 BUTTON_16'
- reboot the phone
- map 'BUTTON_16' with "Buttons remapper" to e.g. "Open Open Camera"
- enjoy
I don't know if this has any sideeffects, i just wanted to have this button work right now I think you need the full version of "Buttons remapper".

chepaz said:
You need root access and "Buttons remapper" from Playstore.
- move to '/system/usr/keylayout' and edit 'mtk-kpd.kl'
- at the bottom of the file insert a line 'key 250 BUTTON_16'
- reboot the phone
- map 'BUTTON_16' with "Buttons remapper" to e.g. "Open Open Camera"
- enjoy
I don't know if this has any sideeffects, i just wanted to have this button work right now I think you need the full version of "Buttons remapper".
Click to expand...
Click to collapse
The free version works just fine, been using it on stock ROM for quite a while

Jonny said:
The free version works just fine, been using it on stock ROM for quite a while
Click to expand...
Click to collapse
Thanks for this hint. I bought it someday, so i didn't know if the "free"-version is just enough.

Hi.
What is a number of left hand said buttons in keylayout file?
I want to use is as a power button.

sqrwiel said:
Hi.
What is a number of left hand said buttons in keylayout file?
Click to expand...
Click to collapse
I'm not shure i get your point, but the key returns the code '250'. In the example above it is mapped to BUTTON_16 which is interpretet by 'Buttons remapper'. There you can configure the action of your desire.
In the latest CM13 from Deepflex this workaround is not needed anymore, theres now a beautiful build-in configuration.

key 399 GRAVE
key 2 1
key 3 2
key 4 3
key 5 4
key 6 5
key 7 6
key 8 7
key 9 8
key 10 9
key 11 0
key 230 SOFT_RIGHT
key 60 SOFT_RIGHT
key 107 ENDCALL
key 62 ENDCALL
key 229 MENU
key 59 MENU
key 127 SYM
key 217 SEARCH
key 228 POUND
key 227 STAR
key 231 CALL
key 61 CALL
key 232 DPAD_CENTER
key 108 DPAD_DOWN
key 103 DPAD_UP
key 105 DPAD_LEFT
key 106 DPAD_RIGHT
key 115 VOLUME_UP
key 114 VOLUME_DOWN
key 113 MUTE
key 116 POWER
key 212 CAMERA
key 211 FOCUS
key 16 Q
key 17 W
key 18 E
key 19 R
key 20 T
key 21 Y
key 22 U
key 23 I
key 24 O
key 25 P
key 26 LEFT_BRACKET
key 27 RIGHT_BRACKET
key 43 BACKSLASH
key 30 A
key 31 S
key 32 D
key 33 F
key 34 G
key 35 H
key 36 J
key 37 K
key 38 L
key 39 SEMICOLON
key 40 APOSTROPHE
key 14 DEL
key 44 Z
key 45 X
key 46 C
key 47 V
key 48 B
key 49 N
key 50 M
key 51 COMMA
key 52 PERIOD
key 53 SLASH
key 28 ENTER
key 56 ALT_LEFT
key 100 ALT_RIGHT
key 42 SHIFT_LEFT
key 54 SHIFT_RIGHT
key 15 TAB
key 57 SPACE
key 150 EXPLORER
key 155 ENVELOPE
key 12 MINUS
key 13 EQUALS
key 215 AT
key 164 MEDIA_PLAY_PAUSE
key 128 MEDIA_STOP
key 163 MEDIA_NEXT
key 165 MEDIA_PREVIOUS
key 168 MEDIA_REWIND
key 159 MEDIA_FAST_FORWARD
#key 249 FUNC1 WAKE
#key 250 FUNC2 WAKE
This is a full list of mtk keylayout
I need move my broken power <wake_up_screen> from right to left.

sqrwiel said:
I need move my broken power <wake_up_screen> from right to left.
Click to expand...
Click to collapse
Ah, ok. Current i'm on "Final Build 2". Mapping the Keycode 250 to something else seems to have no effect anymore. All i got is the "default" behaviour which puts the phone in "mute mode". "Key event display" doesn't show up an keycode then, "Button remapper" seems also useless.
Depending on the ROM-version you use there possibly is a way to remap this button like you want it to - but i have no idea how to achieve this in "Final Build 2". Sorry, i can't help.

I'm on last update of CM and its not working(( pretty bad, it will be awesome to get it work... Please help us))
---------- Post added at 11:38 AM ---------- Previous post was at 10:47 AM ----------
I fell so dumb :laugh: On last CM release you have an app for this in menu : Shortcut button settings
I spent 6 hours because of that, like retarded.... ?

I've been using it with Xposed Additions module... it's recognized as Button 277. I use it as media play/pause when screen is off and as Menu button when screen is on.

K-S-D said:
I'm on last update of CM and its not working(( pretty bad, it will be awesome to get it work... Please help us))
Click to expand...
Click to collapse
Hi, I had the same problem and have created a patch to be able to configure the LEFT KEY as MENU or any other code you want. Hope it is useful for anybody!
PATCH: Use LEFT BUTTON as MENU KEY / GOOGLE NOW on long press
ELEPHONE P9000 / Cyanogen CM13 final build
Code:
filedropper.com/elephonep9000deepflexcm13patchmenuonleftkey_1
This is a patch for DeepFlex CM13 final build that configures the Elephone Left Key as the missing MENU key, neccessary for some applications. It is needed a patch at keyboard driver level, because the cyanogen driver included captured the keycode of the left key (250) to do the hardcoded actions of muting the phone or running the custom application selected in the elephone app (com.shev.elebuttonsettings). Unfortunately that app is unable to set MENU key as the action, otherwise this patch won't be neccessary.
After applying the patched com.cyanogenmod.keyhandler.jar, the keycode will not be intercepted and be available to Android. So you can use the mtk-kpd.kl as usual to map it to any key or button. Please mind that you will lose the existing left key functionality (elebuttons app + mute phone) getting instead the standard menu key, that will also fire up Google Now on long press.
It would be cool if @Deepflex would kindly consider the option if e has the time to make the hardcoded action optional or enhance the elebuttons app to support system keys.
There are two files:
com.cyanogenmod.keyhandler.jar
- This file has to be copied to /system/framework in your android device.
- You should backup the existing file to revert the changes
- This patched version just disables the hardcoded behaviour of the LEFT KEY, that executed the app com.shev.elebutton, letting instead then Android use the keycode normally.
mtk-kpd.kl
- this file has to be copied to /system/usr/keylayout/
- Here we map the LEFT KEY (code 250) to the MENU key (or whatever other key you want)
INSTALLATION
There may be other ways, but in resume you need to be root to enable writing on the /system/ folder and copy the patch files to the required locations.
STEP 1: Copy the patch files into the phone sdcard
via adb from your computer, in the directory where these patch files are located:
Code:
adb push com.cyanogenmod.keyhandler.jar /sdcard/
adb push mtk-kpd.kl /sdcard/
adb shell
these two copy the patch files from your computer to the sdcard, and enter the phone.
(NOW YOU'RE ON THE PHONE)
STEP 2: Become superuser and enable write on system partition
You might need to enable root requests on the developer settings. ( "root: apps and adb")
Code:
su
mount -o rw,remount,rw /system
become superuser (you should see "[email protected]:/ #" if you are root), and then enables writing on the system partition.
STEP 3: copy the patch files, that should be in /sdcard/
Code:
cp /sdcard/com.cyanogenmod.keyhandler.jar /system/framework/
cp /sdcard/mtk-kpd.kl /system/usr/keylayout/
STEP 4: Wipe Dalvik cache
WARNING: THE FOLLOWING COMMAND WILL ERASE THE DALVIK CACHE.
BE VERY VERY SURE THAT YOU TYPE IT EXACTLY AS IT IS, BECAUSE
ANY MISSPELLING CAN DELETE EVEN THE WHOLE OPERATING SYSTEM.
If you are scared, just skip this step, and wipe the DALVIK CACHE
from TWRP
Code:
rm -r /data/dalvik-cache
STEP 5: Revoke write permission
Code:
mount -o ro,remount,ro /system
STEP 5: Reboot the phone.
- If you wiped dalvik cache, just reboot normally
Code:
reboot
- If you didn't, reboot into recovery mode and wipe the cache from there.
Code:
reboot recovery
Hope this is useful to somebody!!

Related

[HOWTO] Remap Hardware Buttons

When you move your software buttons to status bar, there is a problem with apps that cover full screen and don’t have “menu” or “back” button. For example “Gallery”. You have to push longer power buttons and switch to buttons mode to end application or get to menu. I have found this quite irritating so I prefer to have “one click” button to get this working. When you get lcd density to 130, your status bar is very small and is difficult to touch soft buttons.
By editing file /system/usr/keylayout/qwerty.kl you can remap your buttons.
Note that this require permanent root with rw access to system partition.
Ive tested this on Archos 70 rotted with OC kernel http://forum.xda-developers.com/showthread.php?t=897877 it should work with chulri method http://forum.xda-developers.com/showthread.php?t=930197 and UrukDroid http://forum.xda-developers.com/showthread.php?t=895599.
Thx guys for great work
Doesn’t work with Archangel because it needs rw acces to /system/.
Maybe some “magic” can make a script to force android to use keyboard layout from different location (sdcard for example).
Like with all operations on system files, you can broke your system when something goes wrong. Remember, I'm not responsible for anything.
If you use other keyboard than default you probably have to edit another file from /system/usr/keylayout/. I’ve tested this only for standard keyboard.
After made changes to qwerty.kl you have to restart device.
In this example I’ve remapped + button as “Menu” and Volume – as “Back”.
Remember that you will loose ability to control volume with hardware buttons.
To set to default mapping simply copy original file or edit it and restart device.
Before you start, make a backup of original file.
Go to terminal:
Code:
su
cp /system/usr/keylayout/qwerty.kl /system/usr/keylayout/qwerty.kl.org
Next, open /system/usr/keylayout/qwerty.kl file with text editor
And find line
key 115 VOLUME_UP
key 114 VOLUME_DOWN
key 116 POWER WAKE
These are our hard buttons.
Change it to
key 115 MENU
key 114 BACK
key 116 POWER WAKE
Restart android and you have Menu under volume+ and back under volume-
To reset to default, simply go to terminal and:
Code:
su
cp /system/usr/keylayout/qwerty.kl.org /system/usr/keylayout/qwerty.kl
and reboot.
Of course feel free to experiment to other button mapping. :]
very nice. Will be trying this out for sure. Was looking for a better way than button Savior / buttons panel.
Will test during my very busy Friday afternoon work day
Can't "thanks" from tapatalk but will be sure to get you later
Sent from my A101IT using Tapatalk
Nice added to the list of modifications possible with the different root methods here
diabel44 said:
When you move your software buttons to status bar, there is a problem with apps that cover full screen and don’t have “menu” or “back” button. For example “Gallery”. You have to push longer power buttons and switch to buttons mode to end application or get to menu. I have found this quite irritating so I prefer to have “one click” button to get this working. When you get lcd density to 130, your status bar is very small and is difficult to touch soft buttons.
By editing file /system/usr/keylayout/qwerty.kl you can remap your buttons.
Note that this require permanent root with rw access to system partition.
Ive tested this on Archos 70 rotted with OC kernel http://forum.xda-developers.com/showthread.php?t=897877 it should work with chulri method http://forum.xda-developers.com/showthread.php?t=930197 and UrukDroid http://forum.xda-developers.com/showthread.php?t=895599.
Thx guys for great work
Doesn’t work with Archangel because it needs rw acces to /system/.
Maybe some “magic” can make a script to force android to use keyboard layout from different location (sdcard for example).
Like with all operations on system files, you can broke your system when something goes wrong. Remember, I'm not responsible for anything.
If you use other keyboard than default you probably have to edit another file from /system/usr/keylayout/. I’ve tested this only for standard keyboard.
After made changes to qwerty.kl you have to restart device.
In this example I’ve remapped + button as “Menu” and Volume – as “Back”.
Remember that you will loose ability to control volume with hardware buttons.
To set to default mapping simply copy original file or edit it and restart device.
Before you start, make a backup of original file.
Go to terminal:
Code:
su
cp /system/usr/keylayout/qwerty.kl /system/usr/keylayout/qwerty.kl.org
Next, open /system/usr/keylayout/qwerty.kl file with text editor
And find line
key 115 VOLUME_UP
key 114 VOLUME_DOWN
key 116 POWER WAKE
These are our hard buttons.
Change it to
key 115 MENU
key 114 BACK
key 116 POWER WAKE
Restart android and you have Menu under volume+ and back under volume-
To reset to default, simply go to terminal and:
Code:
su
cp /system/usr/keylayout/qwerty.kl.org /system/usr/keylayout/qwerty.kl
and reboot.
Of course feel free to experiment to other button mapping. :]
Click to expand...
Click to collapse
diabel44 said:
I
Click to expand...
Click to collapse
I have edited .kl file using both ES File Explorer & adb shell , but edited file is restoring to previous on reboot. Is there a way to permanently change the .kl files
MASTER MC said:
I have edited .kl file using both ES File Explorer & adb shell , but edited file is restoring to previous on reboot. Is there a way to permanently change the .kl files
Click to expand...
Click to collapse
I got it. It should be edited and changed to /system using twrp recovery.
I mapped volume button to power. It works correctly only when device is powered on and it doesnot reboot when shutdown. Can u tell me where I should make changes to work to power on the device .

[Q] Bluetooth keyboard mapping

Hello,
I have successfully paired my stowaway Bluetooth keyboard with the GT. However I am not able to change the keymapping of the keyboard to use the German layout of the keyboard. Any ideas out there how to change the mapping?
Interesting: Under /system/use/keys... there is a Motorola bluetooth Keymap ...
First off, thanks for trying this out, haven't got around to trying my iGo stowaway keyboard, so nice to know it should work. In regards to keyboard mapping this thread may be helpful:
http://forum.xda-developers.com/showthread.php?t=799079
Thank you for the link. Theres a lot of mapping to try out I had allready been playing around with the charmap files but the description in the link is much more detailed.
if you can't get it to work properly with the work people have already done, it's pretty simple to manually edit the keymap.
1. plug in the tab and start adb shell
2. run the getevent command
3. press a key and look at the middle number that shows up. should look something like
/dev/input/event1: 0001 0073 00000001
/dev/input/event1: 0001 0073 00000000
Click to expand...
Click to collapse
I forget what the first number but the second number is the key(in this case, volume up) and the third is the state(1 down, 0 up).
4. convert the key number from hex to decimal.
5. cd /system/usr/keylayout
6. cp qwerty.kl qwerty.bak
7. exit adb shell
8. adb pull /system/usr/keylayout/qwerty.kl
9. open up qwerty.kl and look for the key that you found in decimal(not the original number).
10. edit the file and push it back to /system/usr/keylayout
if this does not work, try editing Generic.kl
Thank you for the information.
Funny thing is, that the qwerty.kcm on the GT 10.1V is not a .bin-file. It is simply editable with a Text editor:
key A {
label: 'A'
number: '2'
base: 'a'
shift, capslock: 'A'
alt: '#'
shift+alt, capslock+alt: none
}
key B {
label: 'B'
number: '2'
base: 'b'
shift, capslock: 'B'
alt: '<'
shift+alt, capslock+alt: none
... and so on.
So the first step would be to find the key number (with "keytest" or getevent), followed by changing the mapping of the keys.
I wonder if I could just add:
FN_left: 'behaviour'
FN_right: 'behaviour'
additionally.
I'm not sure exactly what you're planning on doing, but I can tell you right now that adding things to qwerty.kcm will not work. It's strange that it's not a bin file but anyway, there are many different files that use the same values as qwerty.kcm that need to be edited accordingly. Obviously in honeycomb it is a little bit different, but I know that in froyo, you needed to edit KeyEvent.java, KeycodeLabels.h, nav_keys.py, attrs.xml and Monkey.java before the values in qwerty.kcm could take effect.
That being said, you can edit the values that are already there.
I work for the android dev team at Broadcom and I found all of this out while trying to add support for the escape key on hardware keyboards. I wanted to be able to use vi on an android tablet. I did have the escape key working, but google does not allow for vendor specific key mappings so I would have had to "contribute a patch to the open source project to define those new codes" in order to "maintain a consistent set of key code definitions across all Android devices." I didn't really feel that this was worth it since most apps that require an escape key(connect bot for example) have another way of doing it.

Stop Home key from waking screen

**Must have root**
As the title says, stop your home key from waking your device.....(then only power button wakes it up )
you can do this simply with root explorer
(THERE ARE OTHERS TO USE MAYBE EVEN FREE, THIS IS ALL I HAVE EVER USED IS ALL)
ONLY MODIFY THE FILE SPECIFIED!
OR PLAY AROUND AT YOUR OWN RISK AS NOTHING OTHER THAN MENTIONED FILE IS TESTED....
open root explorer
navigate to : system/usr/keylayout
now press the mount r/w button near the top of screen to enable read and write permissions
scroll down to: sec_keys.kl
press and hold until menu pops up, select: Open in Text Editor
locate line: key 172 HOME WAKE
tap behind the word WAKE and delete it so you see: key 172 HOME
press menu and select: Save and Exit
now press the button at the top of the screen to disable read and write permissions: Mount R/O
(once pressed should now read : Mount R/W again.
Exit root explorer
Reboot your phone
see if it works
Credit goes to Eric
I don't have that file in /system/usr/keylayout, i have wanamlite 1.8 rom.
Thank you very much!
This works on my T999 (TMO SIII)
Where is this mysterious keyboard layout file on a STOCK rom?
EDIT: nvm got it I suppose it's gpio-keys.kl

[Q] Remap S4 buttons like S5

I wanted to know how can i remap the buttons of S4 and make them like S5, I had Ozcan Rom 4.4.2 on my i9500 but after upgrading to Lollipop the buttons are changed.
I want that the right soft button will be recent apps and the middle button to be Home, and change also the long press buttons ?
Hi,
For long press I don't know how to configure. And do you mean nav bar or physical ones?
If navbar you have to see for the ROM settings, if you mean the physical ones you'll have to edit this file:
/system/usr/keylayout/sec_touchkey.kl
I believe you've mistyped the configuration you want, I believe you meant left button for Recent and right button for back (like S5). Then, change it, so it looks the following:
Code:
key 139 APP_SWITCH
key 158 BACK
key 102 HOME
key 217 SEARCH
You can make the edits using a terminal or a file manager with text editor that has root access. Remember to mount system as RW before!! To do it on terminal, input:
Code:
su
mount -o rw,remount /system
All the best,
~Lord
"This Story Ends Where It Began" - Octavarium (Dream Theater)
Sent from my GT-i9505

SWAP back and recent apps keys Marshmallow 6.0.1 (need root)

goto your favorite file explorer. i used root explorer. make sure you have root access and goto /system/usr/keylayout and then make sure you have read write access. then click on generic.kl
change line key 158 to APP_SWITCH
change line key 254 to BACK
make sure to save. reboot. back key should now be on left. recent apps on right. you can still hold your recent apps key which is now on the right to get menu in some apps.
and for my next trick... modding s pen to left side of note 4. just kidding. enjoy.
Is this safe?
its only for galaxy?;I need on moto g (aosp, MM). on screen key.
Yes very safe. Yes only for galaxy. Not sure how you do it with moto g. You could try developer options RTL mode and see if that works but will RTL everything else. Or you could try my method and see if you could swap the back and recent apps same way but different lines. That is if moto g is setup similar.

Categories

Resources