I want to be able to use the headset + and - buttons as track forward/back controls rather than volume (i.e. how my previous HTC phone worked). I've installed the trial version of Headset Button Controller, but although it seems to work fine for the play/pause button, the + and - buttons always cause the onscreen volume function to activate.
Any ideas? Is this app compatible with my S3, and if not could you suggest another app which works to reconfigure the +/- buttons? Is there maybe a discussion thread for this app here, as I can't find one? Thanks.
Andre
If you're rooted, Tweakbox (needs Xposed) will let you do what you're asking for when the headset buttons are held down (this also extends to the volume buttons on the phone proper) but only if the phone is locked and its screen off. The headset play/pause button works without any external application needed, at least for the stock music player. I've been using Tweakbox for a while on my GSIII with no problems (just don't choose to install the libraries in Xposed - they're older versions).
Thanks, but a bit convoluted and limited to screen-lock time - plus I'd prefer to keep the on-phone volume keys working as normal volume keys. Still, it's worth considering if there are no other ideas. (The phone is rooted though; I did that almost as soon as it came out of the box)
Andre
andrewilley said:
limited to screen-lock time
Click to expand...
Click to collapse
If you happen to have the SDK installed, you can change that: https://github.com/rovo89/XposedMod...ed/mods/tweakbox/VolumeKeysSkipTrack.java#L26
plus I'd prefer to keep the on-phone volume keys working as normal volume keys
Click to expand...
Click to collapse
Ah, fair enough, but since it only comes into play if the buttons are held down I'm perfectly fine with it.
Best regards
I'd really like to get Headset Button Controller (or similar) working to be honest.
I currently (on my HTC) use single-clicks on the headset's +/- buttons for next/previous track, and double-clicks for next/previous album folder, and I'd also like to have long-pressing for fast-forward and fast-rewind if possible. Plus keeping the on-phone volume keys for normal volume control.
Andre
Update to this...
I've managed to get the second and third headset buttons acting as next/previous track functions - without needing any extra software (although of course you can add extra facilities using Headset Button Controller later if you wish). The side volume rocker still works for volume control.
Christoph Kober pointed me to some documentation on the Android key mapping files (http://source.android.com/tech/input/key-layout-files.html) which helped me in the right direction. I first tried to edit the small file which looked like it handled the headset, but that did not change anything. Then I tried editing the master key mapper file, and that did the job. I assumed that this would also remap the on-device volume buttons too, but fortunately there is another mapping file which overrides the generic one to handle the four hardware buttons - so they get re-mapped back to volume again. Perfect!
You'll need root access and a text editor for this. Don't mess with this lightly, you are editing system files!!!
1) Navigate to folder /system/usr/keylayout/
2) Backup the current Generic.kl file (you were going to do that anyway, right? If you weren't, probably best not go any further...)
3) Edit the file Generic.kl using a text editor
3) Comment out the lines for keys 114 and 115 (just put a # at the start of those two lines) thus:
# key 114 VOLUME_DOWN WAKE
# key 115 VOLUME_UP WAKE
4) Find the lines for keys 163 and 165, which look like this:
key 163 MEDIA_NEXT WAKE
key 165 MEDIA_PREVIOUS WAKE
5) change the numbers from '163' to '115', and from '165' to '114', thus:
key 115 MEDIA_NEXT WAKE
key 114 MEDIA_PREVIOUS WAKE
6) Save and reboot
Andre
I changed the values in the Generic.kl file and it worked.
I decided to change the values back and give Headset Button Controller a try. It didn't work. I tried uninstalling it and now no controls on the headset works.
I read that JAYS Headset Control was a good alternative. That also doesn't work. Seems that I killed all the headset control functions.
How can I get the controls to come back?
I changed settings back and forth a few times with the .kl files, and as long as I rebooted between changes it worked fine.
Also, Headset Button Controller worked fine to re-assign the functionality of those new headset >> and << buttons, but only after I'd first activated them using the .kl file edits of course.
Does copying your original backup Generic.kl file back into place not get you back to your original stock settings? If not, do you have a nandroid backup you can roll back to?
Andre
Thanks for the reply.
I don't think I have a nandroid backup. I did copy the old backup file of Generic.kl file back and still hasnt given me back the old functions.
What do you suggest? Go back to the old original file or do I edit to what what you have done?
Well if you go back to the original file and reboot (and that was the only file you touched) then it should go back to the stock settings.
Andre
qwerty12 said:
If you're rooted, Tweakbox (needs Xposed) will let you do what you're asking for when the headset buttons are held down (this also extends to the volume buttons on the phone proper) but only if the phone is locked and its screen off. The headset play/pause button works without any external application needed, at least for the stock music player. I've been using Tweakbox for a while on my GSIII with no problems (just don't choose to install the libraries in Xposed - they're older versions).
Click to expand...
Click to collapse
Thanks heaps for this post. Pretty much got rid of any need for me to flash a custom ROM.
andrewilley said:
Update to this...
I've managed to get the second and third headset buttons acting as next/previous track functions - without needing any extra software (although of course you can add extra facilities using Headset Button Controller later if you wish). The side volume rocker still works for volume control.
Christoph Kober pointed me to some documentation on the Android key mapping files (http://source.android.com/tech/input/key-layout-files.html) which helped me in the right direction. I first tried to edit the small file which looked like it handled the headset, but that did not change anything. Then I tried editing the master key mapper file, and that did the job. I assumed that this would also remap the on-device volume buttons too, but fortunately there is another mapping file which overrides the generic one to handle the four hardware buttons - so they get re-mapped back to volume again. Perfect!
You'll need root access and a text editor for this. Don't mess with this lightly, you are editing system files!!!
1) Navigate to folder /system/usr/keylayout/
2) Backup the current Generic.kl file (you were going to do that anyway, right? If you weren't, probably best not go any further...)
3) Edit the file Generic.kl using a text editor
3) Comment out the lines for keys 114 and 115 (just put a # at the start of those two lines) thus:
# key 114 VOLUME_DOWN WAKE
# key 115 VOLUME_UP WAKE
4) Find the lines for keys 163 and 165, which look like this:
key 163 MEDIA_NEXT WAKE
key 165 MEDIA_PREVIOUS WAKE
5) change the numbers from '163' to '115', and from '165' to '114', thus:
key 115 MEDIA_NEXT WAKE
key 114 MEDIA_PREVIOUS WAKE
6) Save and reboot
Andre
Click to expand...
Click to collapse
Edit: Sorry I thought I was in the att section. You can use the zips to place your file in if you like.
Works great. Here are recovery zips to make it easier. Taken from ATT S3 on LG1.
Download: http://d-h.st/asK
MD5: aa8334da5d76d8e0a0dd26eafac269c6
Uninstaller Download (reverts back to stock): http://d-h.st/2DC
MD5: c2bd8ccbe81c230ef97997267b600d0c
Glad it works. I didn't put up zips of the files that I found, just in case the contents vary by carrier. It seemed such an easy text edit, which carries less risk, so I thought I'd give the method rather than an upload. But feel free to try either.
Andre
andrewilley said:
Update to this...
I've managed to get the second and third headset buttons acting as next/previous track functions - without needing any extra software (although of course you can add extra facilities using Headset Button Controller later if you wish). The side volume rocker still works for volume control.
Christoph Kober pointed me to some documentation on the Android key mapping files (http://source.android.com/tech/input/key-layout-files.html) which helped me in the right direction. I first tried to edit the small file which looked like it handled the headset, but that did not change anything. Then I tried editing the master key mapper file, and that did the job. I assumed that this would also remap the on-device volume buttons too, but fortunately there is another mapping file which overrides the generic one to handle the four hardware buttons - so they get re-mapped back to volume again. Perfect!
You'll need root access and a text editor for this. Don't mess with this lightly, you are editing system files!!!
Andre
Click to expand...
Click to collapse
What would I need to change to keep the Volume buttons as they are but change the Pause button to skip/next track?
Spartoi said:
What would I need to change to keep the Volume buttons as they are but change the Pause button to skip/next track?
Click to expand...
Click to collapse
Not tried it, but I guess you'd need to use the values from the line that controls the middle button:
key 226 HEADSETHOOK WAKE
And swap with the media-next codes from:
key 163 MEDIA_NEXT WAKE
Keep a backup of the original file before you start though, which you can revert to if things go wrong. And see http://source.android.com/tech/input/key-layout-files.html for more details.
Andre
Is there a way to set the headset button to launch S voice when you are holding it?
XblackdemonX said:
Is there a way to set the headset button to launch S voice when you are holding it?
Click to expand...
Click to collapse
I'd suggest using an app, like Headset Button Controller.
Andre
i'll check it out, thanks!
XblackdemonX said:
i'll check it out, thanks!
Click to expand...
Click to collapse
Try Nocs app it's free
Thank you so much for this, this solved all my problems!
One thing I had to after I made the change was to un-install and re-install the headset button controller app. (As I wanted to use it also!)
Related
Is it possible to disable the volume button and enable it instead to start/stop audio note taking?
Thanks
I want todo this exact thing. Any luck with responses?
No.
greatest invention
This is the greatest thing I've been told. Go get a pda, and make notes while your driving etc..
And then they go and remove the function. And replace it with a volume button that doesn't even work properly!!
Martin
Try this...
I dont't know if it will work but maybe you could try this little button mapping tool:
http://romfour.free.fr/adrom/products/btmap.htm
Give us an update if it worked!
No it doesn't. They seem to have removed the mapping id for the volume button. You used to be able to map it through control pannel in really old versions.
Anyone know what it used to be?
Workaround
Hi,
AFAIK it's not possible to use the volume button for other functions, but you'd be able to use another button for this.
I like to have the most common things within some klicks, so I used the calendar-button for audio-recording (you can switch to the calendar by clicking your appointments on the today-screen anyways).
Settings -> Buttons: Set Button 1 to Recording (not sure if the translation is correct, I'm using the german XDA)
Thanks
Thanks for the workaround, yes it works fine, even if I was expecting a start/stop function rather than a push and hold. But now I'm using it I prefer this method.
Mame can remap the volume button so it must be possible.
I have changed my Diamond bay a Touch HD and what I miss more is the d-pad.
I really need it because I read a lot on my device and it is necessary to turn pages, etc. So I searched for a solution.
I've using remaping keys programs for some days, but they are big and have some limitations so I've done my own program with a very simple behaviour:
-Volume UP is remaped to d-pad UP. Can be hold for autorepeat.
-Volume DOWN is remaped to d-pad DOWN. Can be hold for autorepeat.
-Double click Volume UP is remaped to d-pad LEFT. Does not support autorepeat.
-Double click Volume DOWN is remaped to d-pad RIGHT. Does not support autorepeat.
-Double click with hold in Volume UP is remaped to d-Pad RETURN with Hold.Does not support autorepeat.
-Double click with hold in Volume DOWN is remaped to d-Pad RETURN.Does not support autorepeat.
-If a call is being established or is active the volume keys will behave normally.
-Running the file a second time will close the resident with a small tone.
The program is small (7Kb) and remain resident without making use of CPU, it is simply a keyboard hook.
To install it copy the file werever you want and execute it. If you want it to start automatically after a Soft Reset make a link (DO NOT PUT THE FILE DIRECTLY) under \Windows\Startup or your locale equivalent.
REVISIONS
June 24, 2009: I've liberated the source code in order to allow other developers to improve the concept!!
August 28,2009:
-Soved the Back Arrow issue on HTC devices.
-Added support for unloading the program
-First try to add suport for Return-Hold (Context menus)
IMPORTANT
Some users are having issues with VolDpad on HD2 and Diamond 2. This one solves the issue:
http://forum.xda-developers.com/showpost.php?p=8062091&postcount=4
Hope it will be useful
If you like it and want to give me a buck please use this button:
Thanks to the following donators:
Johannes B., Federico, Mike P., Marie-Françoise H.,
DOWNLOADS
Download VolDpad from my site.
really nice app
but does it work in touch pro 2 ?
I've tested it only on a Diamond and on a Touch HD.
But the technology should be the same for the TP2
well this is brilliant! and it works great on my blackstone.
few suggestions:
- it would be a good idea to have command-line support so that you can turn it on and off easily by creating shortcuts or assigning hardware buttons to enable or disable it, or having a status check so that if it's on, next time you run it will turn it off and vice versa.
-it would be great to have both the "ok" button support and the "hold ok" button support so that you can load "right click" menus.. (you can have the upper vol button function as "ok" and lower vol button function as "hold ok")
wonderful work
it works perfectly on my HD!
Virtual button interrupt on HD?
hi all,
installed this on my HD and it works well, but i notice that when i try to use the virtual button to go <Back> (looks like a left arrow <-- ), now it goes up instead.
anyone else have this issue?
This is a fantastic app, will be useful specially for those who play games on their phone. One query; is there a way to remap the vol key buttons? For example can volume up key be mapped to left key, and volume down key mapped to right key. I say this because in Diamond and Touch Pro the Up and Down key on D-Pad functions normally, its only the left key and the right key that has a problem.
I just check - program works good on samsung i780. Is it possible to disable left/right/return function, but remain only up/down? Could you please add (in future version) any configuration file?
Best regards
Tomasz
lifeisaparody said:
hi all,
installed this on my HD and it works well, but i notice that when i try to use the virtual button to go <Back> (looks like a left arrow <-- ), now it goes up instead.
anyone else have this issue?
Click to expand...
Click to collapse
Same here on the Diamond 2, otherwise, fantastic stuff! If we can either get the Back Arrow button to act like the OK, or return it to its former glory, we are good to go!
Brillant, and I agree with the ML idea
fantastic. been looking for something like this for my touch hd
Awesome app! It works great with mobipocket. You can easily start/kill it with mortscripts (put links in the start menu, and you can do it with voice command). Edit the path as necessary.
kill("\Program Files\VolD-Pad\VolDpad.exe")
run("\Program Files\VolD-Pad\VolDpad.exe")
well done job
Nice work thx
vol buttons as a d-pad
Hi....anyone got it working for worms world party?? Kinda miss that game after changing from a kaiser to a blackstone....
thanks in advance.
Great App! Thanks!
Great stuff. I would add my vote to remove the left/right functionality and replace with 'OK' and 'context menu' support. I miss my Kaiser scroll wheel
It is difficult to do smething that will be perfect for all
I'll try to add support for exiting the program (easy) and for context menus (more difficult).
I also revise the issues with the back key.
EDIT: Done
One thing, What context menu can be reached with holding return? I wish to know for testing it
Thanks
Usefull app, I will get use to it.
Does not work for the TG01! After soft-reset it hijacks the bluetooth, switching it on and removing the BT link from the comm manager. It will not allow delete from any folder where it is copied! even the shortcut will not delete. (Had to manually disable the BT, then it auto deletes the shortcut, andyou can delete from a secondary folder. After soft-reset it will again delete from Primary folder, releasing control of the BT!)
Just wondering about the feasibility of (someone with the know-how) creating a background app/service that could monitor and intercept the Nook's Vol+ and Vol- buttons, and if held down for a certain amount of time, perform Menu or Back actions as well.
I would think this possible, based on CM ROMs' ability to skip forwards/backwards from the lockscreen when music is playing, as well as the official XBMC Remote's abililty to change the volume for media playing on an XBMC box without interfering with the volume on the actual Android device.
Under the stock BN ROM I had remapped the Vol buttons, which wasn't a problem since the speaker was barely audible in the first place, but since flashing Dalingrin's OC kernel with the increased volume, I (happily) find the need to be able to change the volume levels easily.
I can't be the only one who's pondered this, but I've read through most of the threads and don't recall seeing this anywhere... If I've missed it, please point me in the right direction.
Thoughts? Takers?
Thanks.
You mean like this easily flashable script in the development forum (page 2).
http://forum.xda-developers.com/showthread.php?t=965023
I am talking an app which would retain volume functionality if the buttons are pressed briefly, as well as implement menu / back functions if held.
Unfortunately it looks like that script you linked to simply remaps the volume keys to menu and back -- without retaining volume functionality:
EpicFail236 said:
[...]
I find that my need for physical menu and back buttons is greater than my need for physical volume buttons.
[...]
This zip is CWM flashable, and simply overwrites the keymap kl files with ones that have the volume buttons remapped.
[...]
Click to expand...
Click to collapse
Not exactly what you want, but a simple solution.
see this, tip #7. Its a simple edit to a text file.
Worked on CM7, heres my edited /system/usr/keylayout/qwerty.kl vol up=menu, down=back
Thanks; unfortunately that is the essentially same as sparhawk's solution, and what I did under the BN ROM.
What I'm looking for is a solution via an application that retains the volume button functionality and augments the buttons with menu/back ability and does not simply remap the volume buttons.
If I had the slightest inkling as to how to do this myself, I would. Unfortunately I've tried and failed (miserably) so far at attempting to learn coding for Android.
I was hoping someone might be familiar with the way CM and XBMC Remote handle these intercepts and be able to adapt code, or create something similar for menu/back functionality.
I get what you are saying, but I don't think it would be possible. Notice how if you hold it down now, it will turn the volume down all the way step by step. When the screen is off, it doesn't do anything. If it was made to be held down to switch function, you would lose the ability to turn down the volume by holding it down. I know what I said is confusing, but just think about it lol. Have you thought about remapping tthe keys totally to menu/back, and then having a sound toggle in the pull down widget for the notification bar? You wouldn't have total control over the levels, but at least its something.
Sent from my ADR6300 using XDA App
Xephik said:
I get what you are saying, but I don't think it would be possible. Notice how if you hold it down now, it will turn the volume down all the way step by step. When the screen is off, it doesn't do anything.
Click to expand...
Click to collapse
I am running CM7 n11 on the nook, and regardless of whether the screen is on or off: if music is playing, when I hit the volume button, the volume level is changed. Not sure what you're referring to.
Xephik said:
If it was made to be held down to switch function, you would lose the ability to turn down the volume by holding it down.
Click to expand...
Click to collapse
I don't necessarily think that's the case.
Example: somehow CM is able to retain volume functionality and add skip next/previous track in music player. When I refer to the ability of CM to skip forward/backwards when music is playing, I am basing this on my experience with CM6.12 on my Droid1.
Xephik said:
Have you thought about remapping tthe keys totally to menu/back, and then having a sound toggle in the pull down widget for the notification bar? You wouldn't have total control over the levels, but at least its something.
Click to expand...
Click to collapse
Yeah, done that and didn't love it. I believe a solution such as I'm suggesting would be much more "integrated," elegant, and convenient.
Basically the app would intercept a volume button press:
- brief press: button release < 300ms, app performs volume function
- long press: button held down or release > 300ms, perform back or menu
Are there any experienced devs who provide some insight?
tj!2k7 said:
Thanks; unfortunately that is the essentially same as sparhawk's solution, and what I did under the BN ROM.
What I'm looking for is a solution via an application that retains the volume button functionality and augments the buttons with menu/back ability and does not simply remap the volume buttons.
If I had the slightest inkling as to how to do this myself, I would. Unfortunately I've tried and failed (miserably) so far at attempting to learn coding for Android.
I was hoping someone might be familiar with the way CM and XBMC Remote handle these intercepts and be able to adapt code, or create something similar for menu/back functionality.
Click to expand...
Click to collapse
I've seen this behavior to control the Android music player. And honesty I don't see why it couldn't be adapted to throw a back or home interrupt. But to implement it is beyond me!
Here is a GitHub repo to handle the Android player on long press up and down but also still handle volume changes on short press.
https://github.com/metalhead8816/android_frameworks_policies_base
And I'm pretty sure the specific commit would be
https://github.com/metalhead8816/an...mmit/7504617a9211a65ce767281c59668e8641b8a14d
Mat Sumpter said:
Here is a GitHub repo to handle the Android player on long press up and down but also still handle volume changes on short press.
https://github.com/metalhead8816/android_frameworks_policies_base
And I'm pretty sure the specific commit would be
https://github.com/metalhead8816/an...mmit/7504617a9211a65ce767281c59668e8641b8a14d
Click to expand...
Click to collapse
We're on a better path now. Thank you for posting concrete evidence of the volume buttons serving two simultaneous functions.
Could that code be used as a base for a standalone background app/service to implement the desired functionality? Better yet if it could be built into a ROM such as CM, but a standalone app would be perfect.
As this is really a question for devs, should I have posted this thread in the dev forum?
This code was put in for eclair so it won't apply cleanly to the Froyo code. But I'm sure a DEV with good Java knowledge could hack this into the current policy framework. From the code this appears pretty integral so I doubt this could be an outside apk that we install. This would likely be an alternate framework we'd need to apply to a ROM much like a style. But again I'm not an Android developer so I don't know for sure.
Button remapper works for the simple remapping, but not for the longpress actions.
I have half a mind to attempt writing a simple service for this
long press menu->vol up in 20% increments
long press back->vol down in 20% increments (may interfere with CM7 long press to kill functionality)
http://android-developers.blogspot.com/2009/12/back-and-other-hard-keys-three-stories.html
http://stackoverflow.com/questions/4983605/send-button-volume-button-action-listeners
http://developer.android.com/reference/android/view/KeyEvent.html
A service sounds (to a non-programmer such as myself) like it would be less involved than framework modifications, and portable across ROM updates.
And personally, I don't mind "losing" long-press-kill functionality as I never use it anyway... I'd love to see some progress along these lines... go for it. =)
If you decide to attempt create a service for this, could you be make the long/short actions customizable?
i.e. :
Short press Vol+: Volume up / Long-press Vol+: Menu
Short press Vol-: Volume down / Long-press Vol-: Back
vs.
Short press Vol+: Menu / Long-press Vol+: Volume up
Short press Vol-: Back / Long-press Vol-: Volume down
In most applications, Menu and Back are usable via the status bar; since that functionality would be redundant, it would be nice to retain quick access to volume for short presses. For instances where Menu and Back are not usable in full-screen applications, long-pressing the buttons to perform menu and back actions doesn't seem like much of an issue.
Actually, if the Menu and Back were long-press actions, couldn't you implement functionality to kill the current app if Back was held for a specific amount of time?
Just thought I'd bump this back to the top... any devs out there who might want to take a crack at something like this?
Until we get Honeycomb AOSP this "hack" would be perfect!
I'm on the lookout too. I'd much rather have my vol up and down keys then have them as back and home. Unfortunately I lack the skills to code it so far!
My prayers, answered. Thanks mad-murdock.
http://forum.xda-developers.com/showthread.php?t=1002000&page=23
So I was looking for a mod/app that will allow me to use the volume buttons to forward or skip tracks. I like the stock headphones that came with the phone, but also have another pair of Sony headphones that also have button controls.
I downloaded Headset Button Control and that didn't work so well. It kept crashing on me.
Any suggestions??
Thanks!
Just double tap play to skip track
Sent from my SPH-L710 using xda app-developers app
double tap work to skip a song.
on custom roms like wanam, long hold the volume + button skips forward. long hold volume - button skips backwards.
tap to play or pause.
Hi,
On stock rom (XXBLF for me), there's a way to transform the vol up/down on the headset to skip/back tracks (vol buttons on the phone are acting normal). I've done this mod on mine and I'm now really happy
You have to be rooted to do this.
1) Navigate to folder /system/usr/keylayout/
2) Backup the current Generic.kl file (you were going to do that anyway, right? If you weren't, probably best not go any further...)
3) Edit the file Generic.kl using a text editor :
- Comment out the lines for keys 114 and 115 (just put a # at the start of those two lines) thus:
# key 114 VOLUME_DOWN WAKE
# key 115 VOLUME_UP WAKE
- Find the lines for keys 163 and 165, which look like this:
key 163 MEDIA_NEXT WAKE
key 165 MEDIA_PREVIOUS WAKE
- change the numbers from '163' to '115', and from '165' to '114', thus:
key 115 MEDIA_NEXT WAKE
key 114 MEDIA_PREVIOUS WAKE
4) Save and reboot
+1 double tap on LG6
+ forward - back
https://play.google.com/store/apps/details?id=se.jays.headsetcontrol
Use this app its free.. No need for a mod then..
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