Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,732,206 Members 43,990 Now Online
XDA Developers Android and Mobile Development Forum

[HOWTO] Assign other buttons to show unlock screen

Tip us?
 
pina_
Old
(Last edited by pina_; 16th June 2010 at 10:30 PM.)
#1  
Senior Member - OP
Thanks Meter 0
Posts: 142
Join Date: Mar 2010
Thumbs up [HOWTO] Assign other buttons to show unlock screen

Has anyone already found a way to display the lockscreen using another button then the power on/off button? I can't get used to the new unlocking method. On my Hero, I just had to press a button to see the lockscreen and I even could press a button twice to unlock it.

I guess it should be possible with rooted phones? But I don't know how ofc...


Solution:

You need to edit the file bravo-keypad.kl in /system/usr/keylayout
Open the file in a text editor, you'll see something like this:

Code:
key 102   HOME
key 139   MENU              
key 158   BACK
key 217   SEARCH

key 107   ENDCALL           WAKE_DROPPED
key 116   POWER             WAKE_DROPPED

key 115   VOLUME_UP         WAKE
key 114   VOLUME_DOWN       WAKE
You'll have to put the string 'WAKE_DROPPED' behind the button you wish to use to unlock. It has been set on POWER and ENDCALL by default.

You need to pull the file first via recovery, edit it, then push it back to your phone. You can only do this via the recovery, not via programs like Root Explorer!

Go into recovery, then type in the following commands:

Windows:
  • adb-nilezon shell mount /system
  • adb-nilezon pull /system/usr/keylayout/bravo-keypad.kl c:\
  • edit bravo-keypad.kl to your liking
  • adb-nilezon push c:\bravo-keypad.kl /system/usr/keylayout/bravo-keypad.kl
  • adb-nilezon shell reboot

Mac:
  • ./adb-mac shell mount /system
  • ./adb-mac pull /system/usr/keylayout/bravo-keypad.kl
  • edit bravo-keypad.kl to your liking
  • ./adb-mac push bravo-keypad.kl /system/usr/keylayout/bravo-keypad.kl
  • ./adb-mac shell reboot

many thanks to RedDragCZ and ritdaw!
 
RedDragCZ
Old
#2  
Junior Member
Thanks Meter 0
Posts: 3
Join Date: Sep 2008
Needs just a little tweak of the "/system/usr/keylayout/bravo-keypad.kl" file, adding the "WAKE_DROPPED" to the end of the line of some other key with which you want to be able to wake up your phone.
Currently, I'm using it this way:
Code:
key 102   HOME
key 139   MENU              WAKE_DROPPED
key 158   BACK
key 217   SEARCH

key 107   ENDCALL           WAKE_DROPPED
key 116   POWER             WAKE_DROPPED

key 115   VOLUME_UP         WAKE
key 114   VOLUME_DOWN       WAKE
Pressing the MENU button now shows the lockscreen and doubletapping it unlocks the device.

Quote:
Originally Posted by pina_ View Post
I guess it should be possible with rooted phones?
You are right, you need to have root access to your phone to apply this patch.
 
pina_
Old
(Last edited by pina_; 18th May 2010 at 08:32 PM.)
#3  
Senior Member - OP
Thanks Meter 0
Posts: 142
Join Date: Mar 2010
Quote:
Originally Posted by RedDragCZ View Post
Needs just a little tweak of the "/system/usr/keylayout/bravo-keypad.kl" file, adding the "WAKE_DROPPED" to the end of the line of some other key with which you want to be able to wake up your phone.
Currently, I'm using it this way:
Code:
key 102   HOME
key 139   MENU              WAKE_DROPPED
key 158   BACK
key 217   SEARCH

key 107   ENDCALL           WAKE_DROPPED
key 116   POWER             WAKE_DROPPED

key 115   VOLUME_UP         WAKE
key 114   VOLUME_DOWN       WAKE
Pressing the MENU button now shows the lockscreen and doubletapping it unlocks the device.

You are right, you need to have root access to your phone to apply this patch.
edit2: Edited the file, saved the file but the phone just reboots and reverts the file back to default settings...
 
teitiel
Old
#4  
Member
Thanks Meter 0
Posts: 44
Join Date: Aug 2009
i have some issues, after putting the edited file back into /system/usr/keylayout I reboot the phone and the file changes back to default, can you help me here?
 
ivicask
Old
#5  
ivicask's Avatar
Recognized Contributor
Thanks Meter 12334
Posts: 3,127
Join Date: May 2009
Location: Zagreb

 
DONATE TO ME
This something i wanted from moment i got phone. Couldn anyone help me to figure this file so that:
1. Disable unlock screen by pressing menu.
2. unlock screen by double pressing optical trackball.

3.Also if i get above 2 working, i would like to disable on screen slide to unlock, so that just double click on optical unlocks phone.
 
ritdaw
Old
#6  
Senior Member
Thanks Meter 3
Posts: 246
Join Date: Jan 2007
Awesome find, works like a charm! My biggest nightmare with the desire is turning it on by accident when I push it in my pocket. Wouldn't be keen on disabling the power button though...
 
pina_
Old
#7  
Senior Member - OP
Thanks Meter 0
Posts: 142
Join Date: Mar 2010
Quote:
Originally Posted by ritdaw View Post
Awesome find, works like a charm! My biggest nightmare with the desire is turning it on by accident when I push it in my pocket. Wouldn't be keen on disabling the power button though...
what rom are you using? It keeps rebooting each time when I edited the file. And how did you edit the file? Perhaps I have to use a different method to edit the file...?
 
ritdaw
Old
#8  
Senior Member
Thanks Meter 3
Posts: 246
Join Date: Jan 2007
Quote:
Originally Posted by pina_ View Post
what rom are you using? It keeps rebooting each time when I edited the file. And how did you edit the file? Perhaps I have to use a different method to edit the file...?
MCR r3.

You need to use adb when in recovery and pull a copy of the file, then edit it and push it back to the same place. You only have full rw to the system partition in recovery.

For example (using windows root tools):
  • recovery-windows.bat
  • adb-nilezon shell mount /system
  • adb-nilezon pull /system/usr/keylayout/bravo-keypad.kl c:\
  • edit bravo-keypad.kl to your liking
  • adb-nilezon push c:\bravo-keypad.kl /system/usr/keylayout/bravo-keypad.kl
  • adb-nilezon shell reboot
 
pina_
Old
#9  
Senior Member - OP
Thanks Meter 0
Posts: 142
Join Date: Mar 2010
Quote:
Originally Posted by ritdaw View Post
MCR r3.

You need to use adb when in recovery and pull a copy of the file, then edit it and push it back to the same place. You only have full rw to the system partition in recovery.

For example (using windows root tools):
  • recovery-windows.bat
  • adb-nilezon shell mount /system
  • adb-nilezon pull /system/usr/keylayout/bravo-keypad.kl c:\
  • edit bravo-keypad.kl to your liking
  • adb-nilezon push c:\bravo-keypad.kl /system/usr/keylayout/bravo-keypad.kl
  • adb-nilezon shell reboot
yeah it works! I used mac os x and it works too
 
myth1001
Old
#10  
myth1001's Avatar
Senior Member
Thanks Meter 11
Posts: 340
Join Date: Nov 2009
Location: Kuala Lumpur

 
DONATE TO ME
Thanks RedDragCZ for the tweak!

Thanks ritdaw for the instructions!!

And thanks pina_ for opening the thread!


HTC One M8
Stock Rom
Samsung SGH-r225m > Nokia 3100 > SE K700i > SE K750 > Nokia N95 > HTC HD2 > HTC Desire > iPhone 4 > Samsung Galaxy S III > HTC One M8

Tags
remap, set
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


TRENDING IN THEMER...