[Q] any key droid x2 screen awake - Motorola Droid X2

Is there a way to have any hard key unlock the droid x2

I do remember reading about this in the developement section. There's something to change in one of the scripts, but I don't remember exactly where or what it was. Try the search or browse around a bit. It's there.
Sorry I wasn't much help.

If you flash CM7 you can have the home key and volume keys unlock the screen.
Settings--CyanogenMod settings--Input--check the box for "volume rocker wake."
I think "home key wake" might be on by default.

Read through this thread:
http://forum.xda-developers.com/showthread.php?t=1403013
I asked the same question in there. There is a file you can edit that can change the actions of the hard buttons. Just be sure to make a backup of the original file when you do it.
EDIT: Not sure if you have to have a certain amount of posts to see links. So heres a quick summary.
In a file explorer, go to /system/usr/keylayout. Open the tegra-kbc.kl file in a text editor (You have to give read/write permissions to edit and save this file on your phone) and you can change the menu, back, search and volume buttons from WAKE_DROPPED to WAKE. Notice how the home button is the only one set to "WAKE". This will make all the buttons wake from the screen being off like the home button does. Again, backup the file first in case something doesnt work right. Im not responsible if you mess something up. But this should work fine.
When I first did this, I did that to the volume buttons and it worked. So it should work with the other buttons as well.

They won't take until after a reboot. I edited the same file to make my search button open my camera.
Sent from my CM7 DEATHMACHINE!

Thanks everyone

I tried this b4 and did something wrong as the phone went dark and would not turn on. Somehow I got to factory reboot and brought it to VW and they replaced.
jsgraphicart said:
Read through this thread:
http://forum.xda-developers.com/showthread.php?t=1403013
I asked the same question in there. There is a file you can edit that can change the actions of the hard buttons. Just be sure to make a backup of the original file when you do it.
EDIT: Not sure if you have to have a certain amount of posts to see links. So heres a quick summary.
In a file explorer, go to /system/usr/keylayout. Open the tegra-kbc.kl file in a text editor (You have to give read/write permissions to edit and save this file on your phone) and you can change the menu, back, search and volume buttons from WAKE_DROPPED to WAKE. Notice how the home button is the only one set to "WAKE". This will make all the buttons wake from the screen being off like the home button does. Again, backup the file first in case something doesnt work right. Im not responsible if you mess something up. But this should work fine.
When I first did this, I did that to the volume buttons and it worked. So it should work with the other buttons as well.
Click to expand...
Click to collapse

Related

[how-to] remap genius key

1) Boot in to ClockworkMod Recovery
2) mount /system from partitions menu
3) adb pull /system/usr/keylayout/latte-keypad-v2.kl latte-keypad-v2.kl
4) Edit file locally, the genius key is: key 187 (make a backup of the original file first)
5) adb push latte-keypad-v2.kl /system/usr/keylayout/
6) Reboot
For more information on remapping keys see: http://forum.xda-developers.com/showthread.php?t=695936
If you want the genius button remaped to ENDCALL (if on a call it will end the call, if not on a call it will lock the screen, if you hold it down it activates the power button menu) and don't won't to edit the file yourself you can download this premodified version, just place it in the directory you are running adb from and skip steps 3&4): http://www.4shared.com/file/ein06_25/latte-keypad-v2.html
Notes:
There is a slight hardware delay on the button press, so whatever you assign it to you need to hold the button for half a second just like with the current genius app.
It does not seem to be any easy task to be able to call an alternate application, for now, you can only reassign the key to something another key already does (letter/number, end call, power, volume, camera, etc.). I'm currently working on being able to call an alternate application.
falken98 said:
1) Boot in to ClockworkMod Recovery
2) mount /system from partitions menu
3) adb pull /system/usr/keylayout/latte-keypad-v2.kl
4) Edit file locally, the genius key is: key 187
5) adb push /system/usr/keylayout/latte-keypad-v2.kl
6) Reboot
For more information on remapping keys see: http://forum.xda-developers.com/showthread.php?t=695936
Click to expand...
Click to collapse
Well, how about that. Great find, falken98!
Complete aside: Is your handle taken from the movie "WarGames"? If so, awesome.
So what are people planning to map to this particular hardware key?
and would we easily be able to make this a end call/sleep key? if so what needs to be changed
kingofyo1 said:
and would we easily be able to make this a end call/sleep key? if so what needs to be changed
Click to expand...
Click to collapse
Sure can, to make end call just change:
key 187 FUNC_4
to:
key 187 ENDCALL WAKE_DROPPED
HebrewToYou said:
Complete aside: Is your handle taken from the movie "WarGames"? If so, awesome.
Click to expand...
Click to collapse
haha. yes, it is. nice catch!
and what about the sleep functionality like on the old mytouch?
YESSS
i started a thread on this and was hard into figureing this out
thanks for the help
kingofyo1 said:
and what about the sleep functionality like on the old mytouch?
Click to expand...
Click to collapse
That i'm not sure about, i'll do some digging and see.
kingofyo1 said:
and would we easily be able to make this a end call/sleep key? if so what needs to be changed
Click to expand...
Click to collapse
glad you asked this, that is what i want my genius button to be and it bugs me that it's not since i hit it all the time when trying to hang up on people(came from G1 so that's where my button was) i will do this later
managed to switch fn and menu on hw keyboard, it was bugging me that i constantly hit menu when trying to hit fn(bad button planning by HTC) but now i have the keys where i want them may have to make a few changes later as well to other stuff(camera and focus should do something else)
its not working whenever i put in adb pull "" it just gives me all the adb options..
kingofyo1 said:
and would we easily be able to make this a end call/sleep key? if so what needs to be changed
Click to expand...
Click to collapse
This is actually working this way for me. If on a call, I can hold it for about half a second, it will end the call. Press it for half a second again, it will put it to sleep. If I press and hold the key, it will bring up the Power options menu. This is after I mapped key 187 to ENDCALL WAKE_DROPPED.
Edit: Also, I love "187" being the Genius key
squidbutt said:
its not working whenever i put in adb pull "" it just gives me all the adb options..
Click to expand...
Click to collapse
Sure you have it typed correctly?
D:\android-sdk-windows\key> adb pull /system/usr/keylayout/latte-keypad-v2.kl
358 KB/s (3675 bytes in 0.010s)
fermunky said:
This is actually working this way for me. If on a call, I can hold it for about half a second, it will end the call. Press it for half a second again, it will put it to sleep. If I press and hold the key, it will bring up the Power options menu. This is after I mapped key 187 to ENDCALL WAKE_DROPPED.
Click to expand...
Click to collapse
That does turn out rather well for that button! No more annoying "say a command".
to make it a search key I:
key 187 FUNC_4
to:
key 187 SEARCH
??
Great find man, I switched it to end call/dropped too and its working perfectly. If anyone figures out before I do to make it the sleep function please post.
FYI, after you remap the key it seems to be safe to go ahead and remove:
vsuite.apk, vsuite.odex, VSuiteApp.apk, VSuiteApp.odex
If you have no interest in the genius button function.
what does the WAKE_DROPPED mean
btw when I pull the file where does it pull to? my sdcard or do I have to put a directory? Someone should just upload the stock file
turboyo said:
what does the WAKE_DROPPED mean
Click to expand...
Click to collapse
WAKE: When this key is pressed while the device is asleep, the device will wake up and the key event gets sent to the app.
WAKE_DROPPED: When this key is pressed while the device is asleep, the device will wake up and the key event does not get sent to the app.
If we figure out how to put the device the sleep there would actually be a difference.
turboyo said:
btw when I pull the file where does it pull to? my sdcard or do I have to put a directory? Someone should just upload the stock file
Click to expand...
Click to collapse
It pulls it to the computer you ran adb from (in the directory you are in), you then edit the file with a text editor and push it back up.
Since you have to edit the file and push it back you might as well just go ahead and pull it first, seems more annoying to try and download it first.
Im getting the same thing with it just listing all the adb commands.. Ahh things like this were so much easier with SUFBS lol, all I would have to do is go to the directory and edit the file right in there

Assign a button to hang up!

I don't know about everyone else, but I've found that I instinctively want to push the home button on my phone when I want to end a call. It's burned me SOOOOO many times. I think it's funny how many Android devices seem to have their buttons mapped wrong! For example, I just bought a Coby Kyros 7015A tablet and it has a "rocker" style button on the top that just logically seems like it should be a volume up/down rocker, but for some odd reason they decided to assign "home" and "Menu" to the two sides of the rocker. In addition, the big silver button in the middle seems like it should logically be the Home button, but it is the back button instead.
After a little fiddling around with my Kyros tablet I discovered where the keymapping files are located:
Code:
/system/usr/keylayout/
there are two plain text files in this directory which need to be modified in order to make changes to keymapping, "qwerty.kl" and the other one is going to be named something to do with your particular device. You will need to edit them with a Unix compatible editor like Notepad++ on Window$, but Gedit or Kate will do just fine on Linux.
After successfully remapping the "back" button as "home" and the home/menu as volume up/down on my Kyros, I decided to tackle setting a button to hang up on my Optimus. Of course the first thing I did was make a backup in the recovery.
NOTE! This may not be a great idea for every ROM. Make sure that before you proceed, your ROM has "Spare Parts" and you can change the default behavior of the "end" button. The default behavior of the End button is to shut the screen off and it can not be changed on some ROMs.
This goes without saying, but you are editing files in /system/ so you will need to be rooted.
On the Optimus running CM7, the two files you need to edit are "qwerty.kl" and the other file is called "thunder_keypad.kl"
Code:
adb pull /system/usr/keylayout/
* make sure you put that last / at the end! it tells it to pull all of the files in the directory.
Editing these files is a pretty straightforward process. Basically, after you pull the files from your phone, you open the files and replace the instances of "HOME" with "ENDCALL". Save the files and push them back to the device, and then reboot. That's it!
Code:
adb push qwerty.kl /system/usr/keylayout/qwerty.kl
adb push thunder_keypad.kl /system/usr/keylayout/thunder_keypad.kl
adb reboot
Now you can hit the home button to hang up during a phone call instead of having to hit one of the hardware buttons to wake up the phone, which usually puts you at your homescreen or somewhere else just to have to get back into the phone call and hit the soft button hopefully before the screen goes black because of the proximity sensor (it's designed to do that!)
Like I had mentioned earlier, you're going to want to go into spare parts and change the default "End" button behavior to "Go to Home". Basically you remapped the end call button to where your home button is and then you're telling the Android OS that the end call button will emulate the normal behavior of the home button. Make sense? Didn't think so...
Works great on Mik's CM7. The only "bug" i've found so far is that when you're in the app drawer, hitting home doesn't take you back to your homescreen.
Here are my edited .kl files
Just in case you're really REALLY lazy and don't want to take the time to edit the files yourself (or if you don't have a Unix compatible editor)
Just remount and push them to /system/usr/keylayout/

[Q] Disable power/lock button

I've read a lot of really good info on this site, but can't seem to find exactly what i'm looking for. i have a cheap Visual Land Connect table that runs ICS. It was dropped on the power/lock button and now the button has no resistance. It doesn't click anymore. I rigged my tablet so i can still use it but it isn't great. what i'm looking to do is disable the power button and us the Back button instead. is this possible. Using ES File Explorer, i've gone into the key layout files and tried a few things in there but nothing i do there seems to work. Each time i manipulate a file it creates a .bak file. i think this is normal. do i need to delete this? Also, there are a bunch of key layout files in there. not really sure which one to do. even if i can disable the power button once its turned on, and map a different button to do this, that would work. any suggestions?

Remap Hardware Buttons?

So I want to remap the hardware buttons, but ran into some issues:
google searches say to edit the /system/usr/keylayout/sec_touchkey.kl (for previous galaxy devices), but this file is mysteriously absent on my stock rooted s4.
I tried other files in this /system/usr/keylayout/ folder; atmel_mxt_ts.kl seemed promising in its content:
Code:
key 139 MENU
key 102 HOME
key 158 BACK
key 217 SEARCH
Changing these, however, did nothing.
Am I searching in the right place, just in the wrong files? Is there a file chmod permission I might be missing?
I think there was also a jar file (android.policy.jar?) I'd have to decompile if I wanted to change the long-press actions for these buttons?
Can I override the double-press home button to do something different than s-voice? (I know I can disable the app itself)
Thanks!
disable the button
Mix3d said:
So I want to remap the hardware buttons, but ran intofiles into some issues:
google searches say to edit the /system/usr/keylayout/sec_touchkey.kl (for previous galaxy devices), but this file is mysteriously absent on my stock rooted s4.
I tried other files in this /system/usr/keylayout/ folder; atmel_mxt_ts.kl seemed promising in its content:
Code:
key 139 MENU
key 102 HOME
key 158 BACK
key 217 SEARCH
Changing these, however, did nothing.
Am I searching in the right place, just in the wrong files? Is there a file chmod permission I might be missing?
I think there was also a jar file (android.policy.jar?) I'd have to decompile if I wanted to change the long-press actions for these buttons?
Can I override the double-press home button to do something different than s-voice? (I know I can disable the app itself)
Thanks!
Click to expand...
Click to collapse
I was also looking all over for this. Did what you did and also other. kl in the system usr no change also . Using 3minit mod. Wanted to disable the hardware button as having the navigation bar and therefore now having two back button.
Anyone here with any idea to share?
kelvinator said:
I was also looking all over for this. Did what you did and also other. kl in the system usr no change also . Using 3minit mod. Wanted to disable the hardware button as having the navigation bar and therefore now having two back button.
Anyone here with any idea to share?
Click to expand...
Click to collapse
i dont have an S4 at the moment and i cant remember the exact file name but its under system/usr/keylayout looking through a rom file i think its gpio-keys.kl just mount the folder as read/write then comment out the lines you dont want using # then reboot
what did you do to enable the navbar when i had i was using an S4 last week the only way i could get it working was with an AOSP rom which meant no samsung camera or IR
*edit i should add that this was on the verizon S4
success disable hardware back button
I finally managed to disable the button. Its in system/usr/generic.kl . Place# infront of key 159 back and reboot. Done.
Got navigation bar using 3minit setting and mod.
If it works for you hitting the Thanks button will help. Cheers
---------- Post added at 05:28 AM ---------- Previous post was at 05:25 AM ----------
Correction. In system/usr/keylayout/generic.kl.
I am on omega v6.0 with 3minit mod.
kelvinator said:
I finally managed to disable the button. Its in system/usr/generic.kl . Place# infront of key 159 back and reboot. Done.
Got navigation bar using 3minit setting and mod.
If it works for you hitting the Thanks button will help. Cheers
---------- Post added at 05:28 AM ---------- Previous post was at 05:25 AM ----------
Correction. In system/usr/keylayout/generic.kl.
I am on omega v6.0 with 3minit mod.
Click to expand...
Click to collapse
Good to know, but my use case is a little different... I'm hoping to swap/ change the soft keys, not disable.
But if generic.kl worked for you, that's a good place for me to start. Will play around and post back if I can swap the menu/back button, hopefully the long press options as well. Ideally I want to move a lot of things around, (long press home for gnow, back to recent, long for menu, menu to back) but we'll see.
I'm on stock rooted, which is why I still need functionality
based on how I see it. I think it could be done
I will try it out if I could swap the menu and home like how you wanted. But you definitely need to be rooted first to edit the files
tried it changing key 139 MENU with BACK. saved reboot with success. Menu function swap to back function.
rem you got to be rooted for this to work. ..
kelvinator said:
I will try it out if I could swap the menu and home like how you wanted. But you definitely need to be rooted first to edit the files
tried it changing key 139 MENU with BACK. saved reboot with success. Menu function swap to back function.
rem you got to be rooted for this to work. ..
Click to expand...
Click to collapse
Is a long press registered as a different key for mapping purposed?
Like menu button is 001 but long press menu is 002?
Ultimately I'd like to be able to make a long press on the home button turn the screen off. That's my end goal with that question.
Mix3d said:
Good to know, but my use case is a little different... I'm hoping to swap/ change the soft keys, not disable.
But if generic.kl worked for you, that's a good place for me to start. Will play around and post back if I can swap the menu/back button, hopefully the long press options as well. Ideally I want to move a lot of things around, (long press home for gnow, back to recent, long for menu, menu to back) but we'll see.
I'm on stock rooted, which is why I still need functionality
Click to expand...
Click to collapse
In the generic.kl file, just change the labels to what you want. For instnace, where it says 117 VOLUME_UP WAKE (thats just an example) remove the volume_up and put MENU or BACK or whatever you want there.
Skipjacks said:
Is a long press registered as a different key for mapping purposed?
Like menu button is 001 but long press menu is 002?
Ultimately I'd like to be able to make a long press on the home button turn the screen off. That's my end goal with that question.
Click to expand...
Click to collapse
The system interupts the key down press, it then launches a post delayed runnable when you press down, if the key is pressed down for the length of that post delayed, then essentially "long press" has been executed. The runnable then consumes the the original key press to prevent the key from executing.
elesbb said:
In the generic.kl file, just change the labels to what you want. For instnace, where it says 117 VOLUME_UP WAKE (thats just an example) remove the volume_up and put MENU or BACK or whatever you want there.
The system interupts the volume down press, it then launches a post delayed runnable when you press down, if the key is pressed down for the length of that post delayed, then essentially "long press" has been executed. The runnable then consumes the the original key press to prevent the key from executing.
Click to expand...
Click to collapse
Right, so then how do we override the long press?
Mix3d said:
Right, so then how do we override the long press?
Click to expand...
Click to collapse
If you are trying to do it via the system. Meaning overriding system button presses, then you will have to edit the smali code. I believe the method is interceptKeyBeforeQueing or something like that.
where the hell is the 'soft' back button on this phone? so annoying i can't find it! or do i need to use a 3rd party launcher and rid of that stock touchwiz crap...phone is not rooted
cobyman7035 said:
where the hell is the 'soft' back button on this phone? so annoying i can't find it! or do i need to use a 3rd party launcher and rid of that stock touchwiz crap...phone is not rooted
Click to expand...
Click to collapse
You are in the wrong place, bud. Please ask questions like this in the q and a forum. This is a development forum for development related discussion.
And do try to be a tad calmer when posting. There are tons of people who will be happy to help. But the aggressive tone of your post will prevent many people from wanting to assist.
Also...really? Its the arrow to the right of the home button on the bottom right of the phone.
Sent from your phone. You should be careful where you leave that thing.
Found this at the AOSP Site:
http://source.android.com/tech/input/key-layout-files.html
Key layout files are located by USB vendor, product (and optionally version) id or by input device name.
The following paths are consulted in order.
Code:
/system/usr/keylayout/Vendor_XXXX_Product_XXXX_Version_XXXX.kl
/system/usr/keylayout/Vendor_XXXX_Product_XXXX.kl
/system/usr/keylayout/DEVICE_NAME.kl
/data/system/devices/keylayout/Vendor_XXXX_Product_XXXX_Version_XXXX.kl
/data/system/devices/keylayout/Vendor_XXXX_Product_XXXX.kl
/data/system/devices/keylayout/DEVICE_NAME.kl
/system/usr/keylayout/Generic.kl
/data/system/devices/keylayout/Generic.kl
Click to expand...
Click to collapse
Another potentially useful resource is this list of keycodes:
http://source.android.com/tech/input/keyboard-devices.html
I haven't had time to play much with this stuff yet, but I DID try the KeynrTracker.apk listed here, however it does not seem to register any of the long presses, leaving us only with menubutton as 139 and back as 158. It could have something to do with the way this app is designed, or in the way Samsung is firing these button presses.
More to come.
Mix3d said:
Found this at the AOSP Site:
http://source.android.com/tech/input/key-layout-files.html
Another potentially useful resource is this list of keycodes:
http://source.android.com/tech/input/keyboard-devices.html
I haven't had time to play much with this stuff yet, but I DID try the KeynrTracker.apk listed here, however it does not seem to register any of the long presses, leaving us only with menubutton as 139 and back as 158. It could have something to do with the way this app is designed, or in the way Samsung is firing these button presses.
More to come.
Click to expand...
Click to collapse
I already explained how long presses work
Sent from my SGH-M919 using Tapatalk 2
elesbb said:
I already explained how long presses work
Sent from my SGH-M919 using Tapatalk 2
Click to expand...
Click to collapse
"Edit the smali code" doesn't really count... what file to decompile? Which lines?
I'm completely new to this level of android modifications
Can this be used to make "Menu" button work as recents and "Menu hold" as menu?
jastonas said:
Can this be used to make "Menu" button work as recents and "Menu hold" as menu?
Click to expand...
Click to collapse
I have changed menu to recents. Just edit the file in system/usr
I haven't changed 'menu hold' to menu yet, requires decompiling and I'm lazy.
3473 said:
I have changed menu to recents. Just edit the file in system/usr
I haven't changed 'menu hold' to menu yet, requires decompiling and I'm lazy.
Click to expand...
Click to collapse
Then how do you use the menu of so many apps that don't have the 3 dots?
3473 said:
I have changed menu to recents. Just edit the file in system/usr
I haven't changed 'menu hold' to menu yet, requires decompiling and I'm lazy.
Click to expand...
Click to collapse
decompiling WHICH file? throw me a bone, dude!
Mix3d said:
decompiling WHICH file? throw me a bone, dude!
Click to expand...
Click to collapse
That's what Google is for! We all started there!! I'll give you a hunt it lies within system/framework directory and starts with an a ^-^
Sent from my SGH-M919 using Tapatalk 2

[Guide] Replace MENU with Recent Apps on CM12.1

This guide is for the Note 3 Neo and should work on all variants.
If you're looking at this thread then you should have noticed that the Menu key on @FireLord 's CM12.1 is mapped to MENU and you can't change it from Buttons in Settings since it only has Power Button, Recents Button, Volume Button and Home button and no Menu Button.
Of course, there are a bunch of Xposed Modules such as MenuBegone available to do the same but if you'd rather not install anything or if you just like to mess with your phone then this is the guide to follow
So here's what you to do make your Menu key function as a Recent's key.
Download any Root Brower (I'd suggest the one included in Rom Toolbox)
Navigate to /system/usr/keylayout/Generic.kl
Open the File Generic.kl as a text file
Look for key 139 MENU in the list
Replace MENU with APP_SWITCH
Save and Reboot
Now your Menu key will function as a Recents Key and you'll also be able to change what tapping it and long-pressing it does through Buttons In Settings.
Thanks for the info.
but do you know how to enable vibration on them?
damadikaz said:
Thanks for the info.
but do you know how to enable vibration on them?
Click to expand...
Click to collapse
Oh I'm sorry, I'm afraid i don't know about that. All the vibrations are on and it seems only the Soft keys aren't vibrating. I'll fill you in if i do find something out though.
ICUDeadNaw said:
Oh I'm sorry, I'm afraid i don't know about that. All the vibrations are on and it seems only the Soft keys aren't vibrating. I'll fill you in if i do find something out though.
Click to expand...
Click to collapse
I've found temporary solution tbh, but it kinda weird. the softkey also vibrate when the screen is off.
http://forum.xda-developers.com/showthread.php?t=2152355
still searching for another solution tho.

Categories

Resources