first backup /system/usr/keylayout/gpio-keys.kl
edit /system/usr/keylayout/gpio-keys.kl,
key 136 SEARCH WAKE_DROPPED
key 139 MENU WAKE
key 102 UNKNOWN
key 158 BACK WAKE_DROPPED
key 116 POWER WAKE
key 115 VOLUME_UP WAKE_DROPPED
key 114 VOLUME_DOWN WAKE_DROPPED
change 3td line to "key 102 UNKNOWN " to disable Home key.
u can change to "key 102 POWER", so u can screen on/off by pressing Home key
Why...?
Is their a reason..?
Related
Is there any way to remap the hardware buttons on the DHD? I use nolock and it works great but my volume buttons wake up my phone and sometimes when I have it in the case on my belt, the volume button gets pressed and some strange things can happen when it's not locked. I would like to remap the volume buttons so that they don't wake the phone up.
That would be no problem at all. That is, if you have full root (S-Off) so that you can write to your system partition.
If so, just edit the file: /system/usr/keylayout/spade-keypad-v0.kl
The original file has the following keymap definitions:
Code:
key 102 HOME WAKE_DROPPED
key 139 MENU WAKE_DROPPED
key 158 BACK WAKE_DROPPED
key 217 SEARCH WAKE_DROPPED
key 116 POWER WAKE_DROPPED
key 114 VOLUME_DOWN WAKE
key 115 VOLUME_UP WAKE
I've swapped the Home and the Search button because I've rather small hands
(I will write a app to redefine these buttons in the future)
I think your problem will be solved by deleting WAKE behind the volume buttons
Thanks, I'll give it a shot.
This is one thing I hate about the different manufactures; different button order.
Sent from my Desire HD
I wrote a tool to edit the keylayout map file simple and easy. Posted it here:
http://forum.xda-developers.com/showthread.php?t=850464
(it says experimental, because it is intented as an app for all Android devices. However, it is tested on the DHD and it works without any problems)
With the app you can turn off the waking up of the device, but you can also assign functions to your keys like call/endcall, media next .. you can swap the home and search button or remap the volume keys to page down/up for ereading (with a hot reboot which will be implemented later, effectuating key redefinitions can be done fast, so that it is also possible to do a temporarily remapping)
Here are some things I have tried by editing the supersonic-keypad.kl file in /system/usr/keylayout .
To re-map the power function to the volume down key (for me this is more convenient) I changed the binding of key 116 (power) to the VOLUME_DOWN intent, and the binding of key 114 (volume down) to the POWER intent. And this works great.
My supersonic-keypad.kl file for this.
key 107 ENDCALL WAKE_DROPPED
key 116 VOLUME_DOWN WAKE
key 115 VOLUME_UP WAKE
key 114 POWER WAKE_DROPPED
key 217 SEARCH WAKE_DROPPED
key 158 BACK WAKE_DROPPED
key 139 MENU WAKE_DROPPED
key 102 HOME WAKE_DROPPED
Now I also tried to map the camera to the power button by changing the intent defined for key 116 to CAMERA. This also works great, but you have to hold the button for about 2 seconds.
Here's my supersonic-keypad.kl file for that.
key 107 ENDCALL WAKE_DROPPED
key 116 CAMERA
key 115 VOLUME_UP WAKE
key 114 POWER WAKE_DROPPED
key 217 SEARCH WAKE_DROPPED
key 158 BACK WAKE_DROPPED
key 139 MENU WAKE_DROPPED
key 102 HOME WAKE_DROPPED
Now trying to be real creative knowing that you must hold to get the camera app to launch, and that the volume works when you just tap the key. I tried to map both of those intents to the power key. Now unfortunately this didn't work as intended. And had an unforeseen side effect when I power off the device.
Here's my supersonic-keypad.kl file for that.
key 107 ENDCALL WAKE_DROPPED
key 116 VOLUME_DOWN WAKE
key 115 VOLUME_UP WAKE
key 114 POWER WAKE_DROPPED
key 217 SEARCH WAKE_DROPPED
key 158 BACK WAKE_DROPPED
key 139 MENU WAKE_DROPPED
key 102 HOME WAKE_DROPPED
Key 116 CAMERA
The behavior expressed from this configuration is that only the camera intent would fire when android was fully loaded. And the unforeseen effect was when I powered off the device the power button didn't turn the phone back on. This doesn't make any sense to me why changing that file would cause this behavior. So I got the phone booted by disconnecting the battery and then with it out connecting the charger and then placed the battery back in. This caused the unit to turn on.
Android loaded and even then the power button did not register. I used the keynumber tracker app to see it was stuck by chance or if the intents were just not working, but the key didn't register there either.
I rebooted into recovery and even there the power button refused to work. So I changed my supersonic-keypad.kl back to my first test config with the volume down mapped to the power button and viola. The power button turns the phone back on again and works in Android as expected from my first test.
So if anyone can explain this behavior that would be great, otherwise I'm leaving this post for those whom may find them selves attempting to re-map their buttons or those that have nullified their power key and want to turn the phone back on.
I don't recall seeing any roms having logo2recents by default, and my current setup did not allow for it either. (I use Android Revolution + Elemental), so I decided to look for a solution.
What you do is this:
-You must have a kernel that enables logo2menu, it'll enable the logo as a button (duh )
-Navigate to /system/usr/keylayout
-Backup the synaptics-rmi-touchscreen.kl file
-Open with the text editor
-Change this line:
key 139 MENU VIRTUAL
To:
key 139 APP_SWITCH WAKE_DROPPED
Save, exit, restart.
Your logo will now load up the recents window.
To me this is much more useful than menu, since most apps have integrated the menu button into their menu bars, so I'd be wasting the use of one capacitive button. I tend to switch between apps much more often, so the quick recents window access is totally worth it.
Side benefit (an odd one that didn't exist before I changed that file). When you go into settings/display&gestures&buttons, there will be a new setting under "buttons." It'll allow you to set tap or long press for recents/menu. Weird how it didn't exist before editing the .kl file above.
Thanks to danny 92 and wednesday13 for pointers from another thread.
*Note, just figured this out. When using this method it breaks the lockscreen shortcuts. No idea how to fix that part, sorry.
great.
this is what Im looking for long time
xposed module "MenuBeGone" could also do the same
I tried changing it to:
key 102 APP_SWITCH WAKE_DROPPED
key 158 BACK
key 139 HOME
So that the setup would be similar to onscreen keys in stock android ie left button: back ; middle button: home ; right button: recent apps.
Now my home button doesn't work even after changing settings to:
key 102 HOME
key 158 BACK
key 139 APP_SWITCH WAKE_DROPPED
Also tried changing settings to:
key 102 HOME
key 158 BACK
key 139 MENU VIRTUAL
and still my home button doesn't do anything.
Had to do a restore from TWRP
I'm running android 5.1 GPE with ElementalX kernal.
Any idea how to make this work, or why the home button doesn't work even after reverting the file?
After restoring I tried just changing the Key 139 line to APP_SWITCH WAKE_DROPPED and leaving everything else as is, and it works as intended. Guess I'll just have to get used to home and recent apps being in the wrong position (and then get used to them being in the right position when I get me new phone)
Hey all,
I have my Nexus rooted and wanted to deactivate the capacitive buttons (except "back") and put a "#" before the following lines:
key 139 MENU WAKE
key 217 SEARCH WAKE
key 102 HOME WAKE
After turning the nexus off and on again, the buttons are still working!
Has anyone an idea?
Thank you!
Cheers,
pan
hi all
i have sgyd and i want to know how to mod hardware keys ?
because i want to change lockscreen key or volume key to camera key for take better shot
I am not exactly sure about this. I just have read this (Never tried).
1) Pull and open /system/usr/keylayout/sec_key.kl with notepad++
2) You will see 3 rows.
a) Row 1 is for attributes.
key 102 #FOR HOME
key 139 #FOR MENU
key 158 #FOR BACK
key 115 #FOR VOLUME_UP
key 114 #FOR VOLUME_DOWN
b) 2nd is for actions
HOME #Launches "Home"
MENU #Launches "Menu"
BACK #Takes you back to the last activity
SEARCH #Launches "Universal Search"
CALL #Launches the "Phone" activity and corresponding .apk or initiates a call
ENDCALL #Ends a call
CAMERA #Launches "Camera" activity and corresponding .apk
FOCUS #Initiates Auto-Focus while using the Camera
VOLUME_UP # Increase Volume
VOLUME_DOWN # Decrease Volume
c) 3rd is for waking up screen on button press.
WAKE #Completes the action without waking the screen
WAKE_DROPPED #Wakes the phone to complete the action
You can add camera action to your volume down button.
Side effect:- If you will press that edited button at home screen(e.g. Volume down to decrease volume) then it will open Camera.apk along with its regular action.
Credits- lokeshsaini94