Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[HOWTO] Assign other buttons to show unlock screen

OP pina_

18th May 2010, 07:21 PM   |  #1  
OP Senior Member
Thanks Meter: 0
 
142 posts
Join Date:Joined: Mar 2010
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!
Last edited by pina_; 16th June 2010 at 11:30 PM.
18th May 2010, 08:13 PM   |  #2  
Junior Member
Thanks Meter: 0
 
3 posts
Join Date:Joined: Sep 2008
More
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_

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.
18th May 2010, 09:00 PM   |  #3  
OP Senior Member
Thanks Meter: 0
 
142 posts
Join Date:Joined: Mar 2010
Quote:
Originally Posted by RedDragCZ

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...
Last edited by pina_; 18th May 2010 at 09:32 PM.
18th May 2010, 09:21 PM   |  #4  
Member
Thanks Meter: 0
 
44 posts
Join Date:Joined: Aug 2009
More
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?
18th May 2010, 09:22 PM   |  #5  
ivicask's Avatar
Recognized Contributor
Flag Zagreb
Thanks Meter: 13,305
 
3,500 posts
Join Date:Joined: May 2009
Donate to Me
More
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.
18th May 2010, 09:42 PM   |  #6  
Senior Member
Thanks Meter: 3
 
246 posts
Join Date:Joined: 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...
18th May 2010, 09:47 PM   |  #7  
OP Senior Member
Thanks Meter: 0
 
142 posts
Join Date:Joined: Mar 2010
Quote:
Originally Posted by ritdaw

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...?
18th May 2010, 09:53 PM   |  #8  
Senior Member
Thanks Meter: 3
 
246 posts
Join Date:Joined: Jan 2007
Quote:
Originally Posted by pina_

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
18th May 2010, 10:13 PM   |  #9  
OP Senior Member
Thanks Meter: 0
 
142 posts
Join Date:Joined: Mar 2010
Red face
Quote:
Originally Posted by ritdaw

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
18th May 2010, 10:42 PM   |  #10  
myth1001's Avatar
Senior Member
Flag Kuala Lumpur
Thanks Meter: 13
 
351 posts
Join Date:Joined: Nov 2009
Donate to Me
More
Thanks RedDragCZ for the tweak!

Thanks ritdaw for the instructions!!

And thanks pina_ for opening the thread!


Post Reply Subscribe to Thread

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

Advanced Search
Display Modes