[MOD] Button Remaping - Nexus S 4G Android Development

I have been searching to fix my broken back key(it only activates when i push on it hard) and came across this thread. Here is a modified version for the ns4g.
How To:
All the commands for the buttons are in
Code:
/system/usr/keylayout
"cypress-touchkey.kl" is for the 4 main buttons
"herring-keypad.kl" includes all of the exterior buttons including the capacitive buttons, but the action only changes for capacitive buttons if you edit the action in cypress-touchkey.kl.
Here all of the actions that you can replace an action with:
"Power", "Home", "Menu", "Back", "Search", "Volume up", "Volume down", "Camera", "Focus", "Endcall", "Call", "Media Play Pause", "Media Stop", "Media Next", "Media Previous", "Media Rewind", "Media Fast Forward", "Dpad center", "Dpad up", "Dpad down", "Dpad left", "Dpad right"
For me, I will be changing the search key to go back instead of searching.
Code:
adb shell
Code:
cd /system/usr/keylayout
Code:
vi cypress-touchkey.kl
*for windows users notepad can be used to edit these files*
Code:
key 139 MENU VIRTUAL
key 102 HOME VIRTUAL
key 158 BACK VIRTUAL
key 217 SEARCH VIRTUAL
key 217 is the search key so
Code:
key 139 MENU VIRTUAL
key 102 HOME VIRTUAL
key 158 MEDIA_PLAY_PAUSE VIRTUAL
key 217 BACK VIRTUAL
As you can see I also changed the back key to play/pause music.
**You can also use a root file explorer such as es file manager to do this. **
Reboot to apply changes
special thanks to Decad3nce and appelflap

reserved for more

Cool, thanks for sharing

Igotsanevo4g said:
Cool, thanks for sharing
Click to expand...
Click to collapse
No problem
Sent from my Nexus S 4G using xda premium

awesome very useful
Sent from my Nexus S 4G using the XDA mobile application powered by Tapatalk

Bobguy21 said:
awesome very useful
Sent from my Nexus S 4G using the XDA mobile application powered by Tapatalk
Click to expand...
Click to collapse
Glad you like it
Sent from my Nexus S 4G using xda premium

There is also a app out there called "Button Remapper" if anyone is interested
Sent from my Kushed Nexus S 4G

Rooster85 said:
There is also a app out there called "Button Remapper" if anyone is interested
Sent from my Kushed Nexus S 4G
Click to expand...
Click to collapse
If you're talking about this thread, it only partially supports sgs variants
Sent from my Nexus S 4G using xda premium

Ahhh yea your right, I just used it when I had my evo shift.... my b bro
Sent from my Kushed Nexus S 4G

Related

[MOD] enable software (screen) keys, disable hardware/capacitance keys

This has been confirmed working in our phone, it's a simple tweak:
to add soft (in the screen) keys follow this:
and8res said:
navigate to system/build.prop
go to the bottom of the page ( document )
add this line
qemu.hw.mainkeys=0
save
reboot
check
Peace
Click to expand...
Click to collapse
to disable hard keys:
maxq1 said:
comment out lines on /system/usr/keylayout/Generic.kl, like so...
Code:
# key 158 BACK
# key 139 MENU
physical home button, however, will still wake up the device (which i prefer) and long pressing on it will bring up s-/google- voice. if you wish otherwise, you can disable it altogether by editing the line on gpio-keys.kl (same directory as above)...
Code:
# key 172 HOME WAKE
then turn off lights via settings/display/touchkey light duration. works on both ics and jb sammy roms. HTH
Click to expand...
Click to collapse
to revert soft keys just make qemu.hw.mainkeys=1
to revert disabled hardware keys take out the #s
Sent from my SPH-L900 using xda app-developers app
Thanks
Nice Work.
Thanks for Sharing.
I think this is also good.
Pretty awesome. Wonder if we csn swap the back key to left side.
Sent from my SCH-I605 using xda app-developers app
reinaldistic said:
This has been confirmed working in our phone, it's a simple tweak:
to add soft (in the screen) keys follow this:
to disable hard keys:
to revert soft keys just make qemu.hw.mainkeys=1
to revert disabled hardware keys take out the #s
Sent from my SPH-L900 using xda app-developers app
Click to expand...
Click to collapse
Sent from my SCH-I605 using xda app-developers app
thankssss
it would be nice if the onscreen keys would pop up automatically when the s-pen is pulled only:good::good:
reinaldistic said:
This has been confirmed working in our phone, it's a simple tweak:
to add soft (in the screen) keys follow this:
to disable hard keys:
to revert soft keys just make qemu.hw.mainkeys=1
to revert disabled hardware keys take out the #s
Sent from my SPH-L900 using xda app-developers app
Click to expand...
Click to collapse
so if you change key 158 to be menu and 159 to be back will the keys change to it as specified?
Great Mods Rein..Worked perfect.
Man, that's killer. Thanks so much. I was actually scared doing that. Never messed around in there before. So, the soft keys are there & I just went into settings & just turned the light off to the hardware keys, but let me get this straight please, all I have to do to take the sofykeys away is turn =0 into =1, that's it (& reboot) TIA & thanks again for this.
Sent from my SPH-L900 using Xparent Blue Tapatalk 2
Question when your watching a video like YouTube does the software keys disappear? I wouldn't like having software keys when I'm watching a video I need full landscape lol
Sent from my SPH-L900 using xda app-developers app
I'm not sure if its a fluke, but I can't take screenshots anymore?
Hello if i enable the softkeys everything works after the first reboot but after the second reboot the softkeys and the line inside build.prop is gone!
Is there a way i could set it permanently?
I thought i could use a .SH script wich adds "qemu.hw.mainkeys=0" to the build.prop every boot? But i don't know what to write?
Would something like this work?
Placed in init.d as 999softkey.sh
Code:
#!/system/bin/sh
chown 0.0 /system/build.prop
echo "qemu.hw.mainkeys=0" > /system/build.prop
dclarolh said:
so if you change key 158 to be menu and 159 to be back will the keys change to it as specified?
Click to expand...
Click to collapse
the hardware ones will, the software ones won't care
Sent from my SPH-L900 using xda app-developers app
wooki said:
Hello if i enable the softkeys everything works after the first reboot but after the second reboot the softkeys and the line inside build.prop is gone!
Is there a way i could set it permanently?
I thought i could use a .SH script wich adds "qemu.hw.mainkeys=0" to the build.prop every boot? But i don't know what to write?
Would something like this work?
Placed in init.d as 999softkey.sh
Code:
#!/system/bin/sh
chown 0.0 /system/build.prop
echo "qemu.hw.mainkeys=0" > /system/build.prop
Click to expand...
Click to collapse
you need to be rooted to do this and you have to do it with a root explorer, my favorite is total commander in the play store, it automatically detects you are trying to save onto a routed folder and asks for permissions
Sent from my SPH-L900 using xda app-developers app
is it true that this will disable screenshots?
reinaldistic said:
you need to be rooted to do this and you have to do it with a root explorer, my favorite is total commander in the play store, it automatically detects you are trying to save onto a routed folder and asks for permissions
Sent from my SPH-L900 using xda app-developers app
Click to expand...
Click to collapse
I am rooted otherwise it wouldn't function at all or?
I works at the first reboot but at second reboot the softkeys are missing again! Maybe its caused by my custom rom?
For more info, there is a detailed discussion on this, over at the themes and mods forum that started a couple of weeks ago:
[How to] Enable on screen buttons
I found that, with the on-screen mod, the camera shutter is cut off.
Here is an ongoing thread in the same forum on modifying the hard keys, including the Home button...
[Mod] Change Home button wake mode
reinaldistic said:
This has been confirmed working in our phone, it's a simple tweak:
to add soft (in the screen) keys follow this:
to disable hard keys:
to revert soft keys just make qemu.hw.mainkeys=1
to revert disabled hardware keys take out the #s
Sent from my SPH-L900 using xda app-developers app
Click to expand...
Click to collapse
thnaks for posting this, will be linked to a lot
So if I want to go back to normal, do I have to write something there or can I just delete the line I put there & reboot. And will that bring screenshots back?
Sent from my SPH-L900 using Xparent Blue Tapatalk 2

[MOD] Enable Navigation bar/ disable HW keys(Nexus 4 style)

I have the At&t version of Optimus G E970, I think this will work for any Optimus G.
Not responsible for bricked phones.
This is a mod how to enable navigation bar(on screen buttons) , its very simple and easy...
To edit build.prop, on root explorer navigate to system press and hold on build.prop and open in text editor.
Add the following line at the end of build.prop file
qemu.hw.mainkeys=0
now on reboot we will have nav-bar like on nexus 4
To disable hardware keys, I used root explorer go to system/usr/keylayout click and hold on kaypad.nl and choose from menu open in text editor and 139,158,172 edit the home to hom and do the same on all 3 lines and hit save and reboot,
Plus I went and deleted all the 139, 158, 172 lines from external_kbd.kl, Generic.kl, MHLRCP.kl, osp3-input.kl and qwerty.kl. I dont know if that helps because I deleted them first then edited the lines in kaypad.nl.
Sent from my LG-E970 using xda premium
Why would I want to do this??
Sent from my LG-LS970 using xda premium
mrjasenr said:
Why would I want to do this??
Sent from my LG-LS970 using xda premium
Click to expand...
Click to collapse
Why would you discourage people from being helpful? If it is not your cup of tea, read and move on.
Sent from my Transformer Prime TF201 using Tapatalk HD
epeereboom said:
Why would you discourage people from being helpful? If it is not your cup of tea, read and move on.
Sent from my Transformer Prime TF201 using Tapatalk HD
Click to expand...
Click to collapse
I'm sorry, you misunderstood. I mean why? As in how would it benefit me. I wasn't being a d*ck. Like I want to know how it is of benefit vs. Hw keys.
Sent from my LG-LS970 using xda premium
mrjasenr said:
I'm sorry, you misunderstood. I mean why? As in how would it benefit me. I wasn't being a d*ck. Like I want to know how it is of benefit vs. Hw keys.
Sent from my LG-LS970 using xda premium
Click to expand...
Click to collapse
My apologies. I think it is more for aestetics.
Sent from my Transformer Prime TF201 using Tapatalk HD
Build.prop in system?
Never mind, got it
Sent from my LG-LS970 using xda app-developers app
Can someone post a picture of build.prop of where the line is supposed to be at? This may be a silly question but I'm new to root, and I really wanna get a nexus 4 feel to my LGOG.
wewooo said:
Can someone post a picture of build.prop of where the line is supposed to be at? This may be a silly question but I'm new to root, and I really wanna get a nexus 4 feel to my LGOG.
Click to expand...
Click to collapse
You just add a separate line to the bottom. Just a new line below everything that reads "qemu.hw.mainkeys=0"
Sent from my LG-LS970 using xda app-developers app
easytheezy said:
You just add a separate line to the bottom. Just a new line below everything that reads "qemu.hw.mainkeys=0"
Sent from my LG-LS970 using xda app-developers app
Click to expand...
Click to collapse
Like right under the last line which is Davik.vm.stack?
EDIT: Nvm got it, but the only problem is that the stock launcher
and keyboard don't have the right resolution.
How does one edit the build.prop?
Never mind! Got it
Sent from my LG-LS970 using Tapatalk 2
The easiest way to disable the default navigation buttons is by going to
system/usr/keylayout/keypad_8064.kl When you open the file you'll find
key 158 BACK VIRTUAL
key 172 HOME VIRTUAL
key 139 MENU VIRTUAL
add a # in the begging of each one like
#key 158 BACK VIRTUAL
#key 172 HOME VIRTUAL
#key 139 MENU VIRTUAL
Reboot and they should be disabled, but the buttons still light up. To fix this go the settings/display/front key light Then uncheck
Turn on Front Key Light.
wewooo said:
The easiest way to disable the default navigation buttons is by going to
system/usr/keylayout/keypad_8064.kl When you open the file you'll find
key 158 BACK VIRTUAL
key 172 HOME VIRTUAL
key 139 MENU VIRTUAL
add a # in the begging of each one like
#key 158 BACK VIRTUAL
#key 172 HOME VIRTUAL
#key 139 MENU VIRTUAL
Reboot and they should be disabled, but the buttons still light up. To fix this go the settings/display/front key light Then uncheck
Turn on Front Key Light.
Click to expand...
Click to collapse
This did the trick for the hard ware keys, now all I have is the soft keys
Sent From my "Slick" Optimus G
Odd, when I do this I cant pull the notification bar down ad the notifications show. It still shows the icons in the top bar. but not when I pull it down?
Also noticed that when I reboot my phone the first notification I get shows up normally, then they stop showing. It notifys me and everything, just cant pull down the blind to access them.
Also noticed that my menu button isnt integrated with the menu bar at the bottom. Ideas on how to do this?
Afteraffekt said:
Odd, when I do this I cant pull the notification bar down ad the notifications show. It still shows the icons in the top bar. but not when I pull it down?
Also noticed that when I reboot my phone the first notification I get shows up normally, then they stop showing. It notifys me and everything, just cant pull down the blind to access them.
Also noticed that my menu button isnt integrated with the menu bar at the bottom. Ideas on how to do this?
Click to expand...
Click to collapse
I can't answer the notification issue, but I believe for the menu button a lot of apps have a built in menu button (usually in an action bar on the top right) now that they display (it is more of a tablet display, but given the resolution it probably still shows up that way).
You can still get to the menu in apps right?
Would there be anyway to disable the softkeys while the lockscreen is on? Because with stock lg lockscreen, it jus shows a black bar
Sent from my LG-LS970 using xda premium
kayslay21 said:
Would there be anyway to disable the softkeys while the lockscreen is on? Because with stock lg lockscreen, it jus shows a black bar
Sent from my LG-LS970 using xda premium
Click to expand...
Click to collapse
That is how it is on my JB tablet with onscreen buttons, I think that is just how it works, but I could be wrong.
How hard is it to make this into a flash able ZIP?
Sent from my LG-LS970 using xda premium
_Epic said:
How hard is it to make this into a flash able ZIP?
Sent from my LG-LS970 using xda premium
Click to expand...
Click to collapse
They have it on the att forum, a zip to enable and one to disable, im pretty sure it'll probably work on our phones too
Sent from my LG-LS970 using xda premium
kayslay21 said:
They have it on the att forum, a zip to enable and one to disable, im pretty sure it'll probably work on our phones too
Sent from my LG-LS970 using xda premium
Click to expand...
Click to collapse
I'll be the test dummy and let y'all know.
EDIT: Don't flash the ZIP, kills the whole alignment of the icons and widgets.
Sent from my LG-LS970 using xda premium
_Epic said:
I'll be the test dummy and let y'all know.
EDIT: Don't flash the ZIP, kills the whole alignment of the icons and widgets.
Sent from my LG-LS970 using xda premium
Click to expand...
Click to collapse
Are you using stock lg launcher? They said it messes that all up unless your using a different one like nova or apex
Sent from my LG-LS970 using xda premium

XDA Premium App

Hi..I installed xda premium app on my HOX..And i can't make a new topic cause i don't have menu button on the bottom of application.. Is there any update or something?
What button do you normally use to open in-app menus ?
It's weird that HTC just put in Back, Home, and Recent Apps (I use the "Menu" button all the time, why would they make that hard to find ?). Is there any way to configure those ? Do any of those buttons perform the function with a long press (my home button will do recent apps on long press) ?
Now i will show ya for example i use 24sata application..
Sent from my HTC One X using xda premium
I Googled it and found this : http://www.androidcentral.com/htcs-fix-menu-button-issue-welcome-not-very-elegant
You can set the "Recent Apps" button to function as a Menu button on long press or vice-versa.
Thank you!
Bro... button savior app is available on play store...
Try it for more keys...
Awesome
Sent from my SGH-T989 using xda premium
Cache directory name on SDCard
comquoordtapatalkxdapreactivity
Click to expand...
Click to collapse
Are you serious?
Can you please it make it more civilized? It is the only app I have with over 100 installed with such an amateurhour obnoxious directory.

Hardware key mapping.

Hey everyone! I've been looking on how to change my hardware keys. As in I would like to get rid of my navigation bar, which I know how to, and make my power button the home key. Or maybe something like one press goes home and then maybe a double tap would shut the screen off. Any suggestions are welcome. Thank you.
Sent from my Galaxy Nexus using xda app-developers app
The easiest way is probably to use a Custom rom which supports hardware key remapping like this one:
http://forum.xda-developers.com/showthread.php?t=2324710
You also can use Zip Themer. like here:
http://forum.xda-developers.com/showthread.php?t=2232770
Now I seen the key mapping feature in du. However I can't make the lock button go to home.
Sent from my Galaxy Nexus using xda app-developers app

How do I remap HOME to MENU key?

hi all,
how do I remap the HOME function to the MENU key? Since the soft keys are a lot easier to press,
I like to do something like:
- press once on MENU to do 'menu' (as before)
- double tap on MENU to do 'home key'
Mine is running stock 4.1.2 and rooted.
Thank you.
mike
No suggestion or is this not possible?
Thanks.
Try the app button savior.
Sent from my SGH-T889 using XDA Premium 4 mobile app
mana4.com said:
Try the app button savior.
Sent from my SGH-T889 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
Thanks. But that's not really what I want. I don't want a set of floating buttons on my screen...
I just want to use what I already have.

Categories

Resources