buttons being pressed in my pocket - Optimus One, P500, V General

Hey guys, is there a way to put the screen to only turn on with the power button?? because in my pocket, the other buttons are pressed, so it's using battery and sometimes stop the music i'm listening. The other buttons that i'm speaking are: Search, return, home and menu. I'm using mik's v6.5.8 with fserve's goldenleaf.

I guess u can! Go to cm setting --lockscreen-- unlock options nd edit as u want ...;-) don't for to press thanks
Sent from my LG-P500 using xda premium

Already asked
Read here.
I'll upload the files, simply put them in /system/usr/keylayout/ (Overwrite existing) and set permissions to 777.

you've made it lanis! thanks, you've helped me a lot =D

now, not to detract from this threads original purpose... but it seems as if the OP got his answer, but while we are on the subject of keys and their functions.
Can we make the search button a pause / play button? with CM7 vol up and down are volume and skip buttons, but there is no physical button for pause play, it would be really nice to have that.

Nice wish they had a thanks button on this app that works great I have been meaning to do this for a while
Sent from my LG-P500 using XDA Premium App running CM7 over clocked at 806

Simply edit the 2 files I've uploaded (You can even edit the original ones) and replace each key's function with the function you want. (Ex. key 222 MENU)

Ianis G. Vasilev said:
Simply edit the 2 files I've uploaded (You can even edit the original ones) and replace each key's function with the function you want. (Ex. key 222 MENU)
Click to expand...
Click to collapse
ya i figured that out with a lil bit of googling. So i now have the search for pause n play with out waking hte phone.
But i would like it to act like the vol up and down buttons in CM7. where they have to be long pressed to skip... id like to have to long press to pause and play on the search, and ONLY when the screen is off / phone is locked like the vol up and down buttons.

dang it would be so awesome to have long press like described above.... if anyone could point me to the vol up and down rocker script that does their long presses i could go from there.

Related

[Q] Possible to bind a hardware key to hang up?

I'm missing the 1.6 "feature" of the caller application hanging upp when I press the power button. Is it in any way possible to configure the phone to hang up when I press a hardware button? Preferably I'd like to bind it to the "back" button, since that's the one I'm least likely to accidentally press.
devzero42 said:
I'm missing the 1.6 "feature" of the caller application hanging upp when I press the power button. Is it in any way possible to configure the phone to hang up when I press a hardware button? Preferably I'd like to bind it to the "back" button, since that's the one I'm least likely to accidentally press.
Click to expand...
Click to collapse
I would like to have the "power-off button to hang up" feature back!!!
Is there any way we can do this?
follow up this guide
http://forum.xda-developers.com/showthread.php?t=829378
instead of changing the FOCUS button, use the key 116 that has POWER on it, change POWER to ENDCALL and change WAKE to WAKE_DROPPED, save it, restart phone and there you go
Press the "back" key. I think it will end the call in progress.
Sent from my X10i using XDA App
sometimes the back button will end it, sometimes not
dermon said:
Press the "back" key. I think it will end the call in progress.
Sent from my X10i using XDA App
Click to expand...
Click to collapse
Back key only seems to work before a call has been answered, but during the call it does not work.
Sent from my X10i using XDA App
ellokomen said:
follow up this guide
http://forum.xda-developers.com/showthread.php?t=829378
instead of changing the FOCUS button, use the key 116 that has POWER on it, change POWER to ENDCALL and change WAKE to WAKE_DROPPED, save it, restart phone and there you go
Click to expand...
Click to collapse
A W E S O M E ! ! ! ! !
Problem solved, I love you! Really.

[Q] Remap power key to launch CRT shutdown app

Need help remapping power key. Someone made awesome app called screen off & lock that does crt shutdown. It would be epic if we could remap power key to launch app.
whoa awesome i just downloaded it. the power button remapping would be awesome, but the long press search button isn't half bad. that's what i'm doing now.
ravigodhwani said:
but the long press search button isn't half bad. that's what i'm doing now.
Click to expand...
Click to collapse
I use voice search all the time. I would think the coding couldn't be to hard but I don't know where to look. It would be awesome if anybody could get this to work.
yeah i'm sure a lot of people use the search button, for some reason i never really need it.
with the camera hack that allows photos to be taken with the power button, and while watching videos, the power button locks the screen while keeping it on, so i know there's gotta be a way to get it to launch this activity. i just don't have any experience with this kind of stuff.
edit -
saw an app called galaxy tuner that apparently remaps buttons, but i am unable to mess with my phone while at work. give it a shot maybe?

remapping hardware touch buttons

Ok, so I've read about how you don't get the ICS quick change/recently used apps button on the new SIii.
Questions 1 is there a way to remap the Menu button so that is does the quick change feature?
2 is there a way to then, the double tap home button feature to get GOOGLE Voice Search/Actions?
3 is there a way that I can add on screen ICS buttons like on the Galaxy Nexus? And then make the hardware home button do something else?
Do I need apps? Rooting?
Thanks!
You need to root. You can turn on software keys with the AOKP rom but you cannot disable the hard keys.
Sent from my GT-I9300 using Tapatalk 2
You can disable the capacitive buttons, but you cannot re map them from what I have found
Sent from my GT-I9300 using Xparent Blue Tapatalk 2
Do you know how to disable the hardware keys?
Sent from my GT-I9300 using Tapatalk 2
i would rather have the task manager open when you hold and press on the back button. the menu button when u hold give u the google search, but on the back button when u hold nothing happens. it would be only logical to apply the task manager to this button when pressed down and held for a a few seconds
Hey I have heard that NOVA launcher pro allows you to customize some of the these short cuts on the phone.
Sent from my Incredible.
Aw yeah.
I do not have the phone yet, but I believe holding the home button will bring up the recent apps. This is how it's been for previous android versions before they made a dedicated button for the galnex
that's how it works for my Dinc, on gingerbread and ics
funkpod said:
2 is there a way to then, the double tap home button feature to get GOOGLE Voice Search/Actions?
Click to expand...
Click to collapse
Long pressing Menu button actually go to google search
ronak47 said:
Do you know how to disable the hardware keys?
Sent from my GT-I9300 using Tapatalk 2
Click to expand...
Click to collapse
1. open /system/usr/keylayout/gpio-keys.kl
2. add # to the beginning of the line of the key you want to disable
3. reboot
in the same file you can remap power key to home key for example
remember to make backup before editinf the file
Sent from my GT-I9300 using Tapatalk 2
bordikun said:
Long pressing Menu button actually go to google search
Click to expand...
Click to collapse
thanks!
google search, or the voice to text?
funkpod said:
thanks!
google search, or the voice to text?
Click to expand...
Click to collapse
both the voice and text search. push the microphone on the searchbarto activate voice search
Sent from my GT-I9300 using Tapatalk 2
Thanks, nice !
Maybe this phone won't be so bad after all ...
Sent from my Incredible.
Aw yeah.
labbe- said:
1. open /system/usr/keylayout/gpio-keys.kl
2. add # to the beginning of the line of the key you want to disable
3. reboot
in the same file you can remap power key to home key for example
remember to make backup before editinf the file
Sent from my GT-I9300 using Tapatalk 2
Click to expand...
Click to collapse
Hi mate,
I've now managed to disable to capacitive buttons.... anyway to disable the light for them as the light still comes on even though they are not enabled and not working
Thanks in advance.
OK so I've managed to get my set up... if anyone wants my set up as per my screenshot then drop me a pm and I shall help you out.
Sent from my GT-I9300 using Tapatalk 2
ronak47 said:
Hi mate,
I've now managed to disable to capacitive buttons.... anyway to disable the light for them as the light still comes on even though they are not enabled and not working
Thanks in advance.
Click to expand...
Click to collapse
Go to Settings/Display under general you will see Touch Key light duration. Options include 1.5 Seconds, 6 seconds, Always off, and always on!
labbe- said:
1. open /system/usr/keylayout/gpio-keys.kl
2. add # to the beginning of the line of the key you want to disable
3. reboot
in the same file you can remap power key to home key for example
remember to make backup before editinf the file
Sent from my GT-I9300 using Tapatalk 2
Click to expand...
Click to collapse
is there a way to stop the home button from waking the device also? (so only the power button wake the device up)
I wonder if you guys can enlighten me. My goal is to have the Home key under the screen function as the power button, and have the normal power button (on the right side of the phone) function as Home (without waking the device). I want this because I'm always unintentionally hitting the power button when I pick up the phone.
I was able to get the Home button to function as power by changing key 116 to 172 in sec_powerkey.kl. However, now the normal power button doesn't do anything. I tried swapping POWER with HOME in sec_keys.kl, but that doesn't seem to do anything.
Any tips on how to give my power button a function now?
timp123 said:
I wonder if you guys can enlighten me. My goal is to have the Home key under the screen function as the power button, and have the normal power button (on the right side of the phone) function as Home (without waking the device). I want this because I'm always unintentionally hitting the power button when I pick up the phone.
I was able to get the Home button to function as power by changing key 116 to 172 in sec_powerkey.kl. However, now the normal power button doesn't do anything. I tried swapping POWER with HOME in sec_keys.kl, but that doesn't seem to do anything.
Any tips on how to give my power button a function now?
Click to expand...
Click to collapse
Check this out bro:
http://forum.xda-developers.com/showthread.php?t=2022024
Let us know if it helped...

Search Key Function

Is there any possible way to change the search key function to be the power instead of search. I am on cm9dx2 and I tried the button remapper APK and it didn't work it would reboot every time I hit apply with no results.
Sent from my MB870 using xda premium
You can change it by modifying the file tegra-kbc.kl located in /system/usr/keylayout. I forget what to change. Let me get back to you on that.
EDIT: Ok, change the line that says
key 217 SEARCH WAKE_DROPPED
to
key 217 POWER WAKE
Then reboot for it to take effect.
Thanks alot. Worked great
Sent from MB870 on Cm9dx2 using XDA Premium
I think we should have a sticky with this and other key layout options, we are a year and then some into this phone and I'm sure everyone who is still on thier first dx2 are all feeling the power button start to die
cm7dx2
LordRalh3 said:
I think we should have a sticky with this and other key layout options, we are a year and then some into this phone and I'm sure everyone who is still on thier first dx2 are all feeling the power button start to die
cm7dx2
Click to expand...
Click to collapse
My button is definitely wearing down. Its not so clicky anymore. It still works though. But its good to know that if it does completely go out, I have this option.

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

Categories

Resources