[HOWTO] Remap Hardware Buttons

Search This thread

diabel44

Member
Mar 4, 2010
18
6
Katowice
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 :D
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. :]
 

d31b0y

Senior Member
Jan 28, 2009
275
30
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 :D

Sent from my A101IT using Tapatalk
 

MASTER MC

New member
Sep 16, 2017
4
0
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 :D
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. :]

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

New member
Sep 16, 2017
4
0
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
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 .
 

Top Liked Posts

  • There are no posts matching your filters.
  • 3
    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 :D
    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. :]