Change volumebuttons function. - Hero, G2 Touch Android Development

This will be hard to explain in english but i will try.
Volumebutton on the side, it turns of my ringer now and then, very annoying. I dont understand why HTC let that button control ringvolume at all wake times.
One solution was to edit keypad.kl, i made volumebutton to a scrollbutton. That solution was of course not so good.
Is there another way? I want it to be able to change volume when playing media but i dont want it to be able to change ringvolume.
Softwarewise there is functions to individually have different sets of volume on media, ringer, messagenotification, this in Settings control panel. Somewhere in the code there should be some kind of call to those functions and give volumebutton access to ringvolume. Maybe possibility to delete that function that lets volumebutton change ringvolume?
Does anyone understand my jibbrish-english?

Perhaps any rom-cooking chef could do an "update.zip" for this purpose? Or is this deep inside the software that needs reorganizing much?

Any chef want to confirm my request are looked into? I want this so very much and i dont think i´m alone with this wish.
Or if its practically impossible, please tell me then so i can drop the idea.
Or if my english is so messed up you dont understand what i mean, tell me so i can try harder to explain.

Yes it can be done, all you would need to do is edit the key bindings located in the following file "system\usr\keylayout\qwerty.kl" , you could do this in a update.zip form or via adb.
What do you want the volume up and down keys binded to do>?

hkkla said:
Is there another way? I want it to be able to change volume when playing media but i dont want it to be able to change ringvolume.
Click to expand...
Click to collapse
I'm also interested in this. Great idea! It has made me miss several calls
Let's not forget that they should work during a call too, which, in my opinion, is even more important.
Would it in some way be possible to stop the volume keys from changing the media volume when the screen is turned off? It's quite annoying when you take your phone out of your pocket and grab it by the volume up button

Stickman89 said:
Yes it can be done, all you would need to do is edit the key bindings located in the following file "system\usr\keylayout\qwerty.kl" , you could do this in a update.zip form or via adb.
What do you want the volume up and down keys binded to do>?
Click to expand...
Click to collapse
Whats the difference between qwerty.kl and keypad.kl? I have tried alter keypad.kl but then vol-button became more or less useless, it lost all volume-functions. I only want it to loose ability to change the ringer-volume and leave the rest of volumes alone.
I pulled qwerty.kl from my phone and it practically looks almost the same as the keypad.kl.
If i change key 114 and 115 in qwerty.kl to be for example scrollbutton i wont be able to change any volume at all with that button?

I too would like a similar function as there really is no need for the ability to change it almost anywhere;, especially with the volume rocker being so easily pushed on this phone. The following would be my preferred set up:
Only adjust media volume while playing media (including screen lock as I find it beneficial to change volume without taking phone out of my pocket)
Only adjust ring volume while in sound settings menu (where it should be!)
Volume adjust while in call should be left as is.

The only thing I would want fixed is that you shouldn't be able to use the volume buttons while the screen is locked/turned off.

Related

Remapping keys on EVO?

I just saw a guide in the Hero forum that allows you to remap keys so you can choose their functions. Is this possible on the EVO? I know the file being pulled/edited would be named differently but can the buttons be altered?
http://forum.xda-developers.com/showthread.php?t=695936
+1, would love to find out as well... i did find an app on marketplace that mapped search key longpress to launch itself so hw (actually sw) key mapping is definetely possible
What would you possibly remap them to do tho?...we only have 3 hard keys.
Longpress search key - toggle vibrate OR launch quick volume/brightness manager. Then, when music app is playing and screen is off/locked - up plays/pauses track, down plays next track, up longpress - rewind, down longpress - fastforward. Turning on/unlocking the phone un-maps the keys and i change the volume with same keys... Will remove the need to turn on lcd and the need to look at the cell while listening to music.
frifox said:
Longpress search key - toggle vibrate OR launch quick volume/brightness manager. Then, when music app is playing and screen is off/locked - up plays/pauses track, down plays next track, up longpress - rewind, down longpress - fastforward. Turning on/unlocking the phone un-maps the keys and i change the volume with same keys... Will remove the need to turn on lcd and the need to look at the cell while listening to music.
Click to expand...
Click to collapse
All nice ideas. Let me know if you ever see something for EVO key mapping.
Id also like a way to do this.. I dont like the lock button location.. when using one handed, I always end up hitting the volume.. or hitting search.. probably because I was used to the lock button on the hero.
It is possible.... here is how!
I first realized how much I wanted to remap keys after I used a cyanogen rom a while back. He had an option that would allow you to let the power key end a call when pressed. This was awesome because I hate ending calls by touching the screen because sometimes I press it twice and accidentally redial and so on... Anyway, I've switched to a million different roms since and this option is not present on any of them. I knew there was a way but figured it was far too difficult. It isn't...
I followed the tutorial from the hero forums using the link in the first post. The file that you need to edit is in the same place that the hero file is in but it's called supersonic-keypad.kl instead. I edited it right on my phone using root explorer... But I'm sure you can use other methods. For my simple edit I changed the second line. I deleted the word power and replaced it with ENDCALL
... I recommend reading the tutorial carefully and making a copy of the file before making any changes just incase. I am going to remap a couple other things now... But that was my main concern. After editing it... Save and then reboot your phone to let the changes take effect...
I hope this helps!

[Q] How to prevent the "click" following Volume change?

The "click" that follows each volume pressing drives my wife crazy, especially at night. Of coarse there is an option to get rid of the woman, but before taking such drastic measure, maybe the experienced folks here have an alternate idea??
The click should only happen when changing ringer volume, and i don't see why you would need to change it that much...
imo, it would be easier just to use the silent/vibrate/volume widget, since ringer volume is usually none or max...
314 said:
The click should only happen when changing ringer volume, and i don't see why you would need to change it that much...
imo, it would be easier just to use the silent/vibrate/volume widget, since ringer volume is usually none or max...
Click to expand...
Click to collapse
Thank you for your reply.
Well, basically you are right. However, in order to avoid the difficulty to press the power button (awfully located) , I am using the "Fix Broken Power Button" app. That requires the use of the volume keys as a substitute to the power switch. Now, each "waking up" the DHD is accompanied with a loud "click", the one whicj I am trying to eliminate.
Thank you for your attention.
Maybe much better to change your wife? )))
Sent from my Desire HD using XDA App
Try a different app, there shouldn't be a sound when unlocking to the lock screen instead of skipping it
CM7 has options to unlock to the lock screen or skip it, and skipping it makes a sound

[REQUEST] Universal 30-step volume mod for AOSP ROMs

Android is notorious--at least in my opinion--for having nowhere near enough granularity in the volume control. With only fifteen steps in the Media volume, music is often either thunderously loud or far too quiet, with no happy medium.
Sure, I did what most folks do and used MusicFX/DSPManager equalizer to boost volume across the board slightly, but while it gives me a decent volume for most of my music, it doesn't solve the problem, it just bandaids it. Each volume increment is too great a leap.
I did notice that a Nexus S ROM, AOSP+, had this mod at one point and I was wondering if it was possible to make a universal CWM-flashable zip that would enable a Galaxy Nexus running an AOSP ROM to gain the benefit of having more granularity in the volume control.
I'm also wondering why the hell Google thought only 15 steps was a good idea...
I'd like this too.
It's not just Android, I find many phones and mp3 players don't provide enough steps in volume.
You can change the amount of incall volume steps by altering "ro.config.vc_call_vol_steps=" in the build.prop to whatever you want (not tried this in ICS though, it might be different), but I don't think changing the amount of system volume steps would be that easy, it would probably have to done from source.
Meltus said:
You can change the amount of incall volume steps by altering "ro.config.vc_call_vol_steps=" in the build.prop to whatever you want (not tried this in ICS though, it might be different), but I don't think changing the amount of system volume steps would be that easy, it would probably have to done from source.
Click to expand...
Click to collapse
It's the number of steps in the Media volume I want to change. In-call volume needs to be turned up all the way in order for me to hear it, anyway.
Check here:
http://forum.xda-developers.com/showthread.php?t=1411317
Use that myself, and it works fine.
However in our roms it's called array_9.
tristan202 said:
Check here:
http://forum.xda-developers.com/showthread.php?t=1411317
Use that myself, and it works fine.
However in our roms it's called array_9.
Click to expand...
Click to collapse
Would this potentially break the screen-off volume controls to skip tracks? I'm game to give it a shot myself later on, but it'd be nice to know if it interferes with any other mods.
This is exactly what I want (for AOKP ROM hehe). I was at the gym listening to Google Music with headphones and kept going between two volume levels..one was too loud and the other too quiet, no perfect medium. Such a stupid thing of Google to overlook.
Or we need voodoo
Sent from my Galaxy Nexus using Tapatalk
synaesthetic said:
Would this potentially break the screen-off volume controls to skip tracks? I'm game to give it a shot myself later on, but it'd be nice to know if it interferes with any other mods.
Click to expand...
Click to collapse
No, it doesn't affect the volume rocker track skip.
Sent from my Galaxy Nexus using xda premium
I've modded the framework.jar file but I haven't actually put it in yet, because I've noticed something else that's rather odd. My GN will more often than not bump up two volume notches every time I press the volume key!
I'm not really sure what's going on here. Maybe I need to reboot, but when I press up or down on the volume rocker, about 80% of the time it moves by two steps rather than just one.
Edit: Applied the modified framework.jar. No problems so far, but my volume key still seems to skip two steps (though now the steps are half the size) after the first press. There's a pattern to it. The first press of the key will only increment once, but all subsequent presses in the same direction will increment twice. So if you have the volume set at 15/30 and press up once, it'll go to 16/30, but if you press again, it'll go to 18/30 instead of 17/30, and continue to go up by two every time until you press Volume Down. Pressing Volume Down at 18/30 will reduce it to 17/30, but then any subsequent Volume Down presses will decrement by two.
This is annoying, though it does seem to explain why I was fairly easily able to find a happy median volume on my Nexus S with 15 volume steps, but never quite was able to on the GN without a lot of ****ery. Because when I'm pressing the damn volume keys, it's not always only incrementing by one! >.<
Though now with the 30-step volume applied, the "skip two" effect is basically nullified. Still, I'd like it to work properly.
synaesthetic said:
I've modded the framework.jar file but I haven't actually put it in yet, because I've noticed something else that's rather odd. My GN will more often than not bump up two volume notches every time I press the volume key!
I'm not really sure what's going on here. Maybe I need to reboot, but when I press up or down on the volume rocker, about 80% of the time it moves by two steps rather than just one.
Edit: Applied the modified framework.jar. No problems so far, but my volume key still seems to skip two steps (though now the steps are half the size) after the first press. There's a pattern to it. The first press of the key will only increment once, but all subsequent presses in the same direction will increment twice. So if you have the volume set at 15/30 and press up once, it'll go to 16/30, but if you press again, it'll go to 18/30 instead of 17/30, and continue to go up by two every time until you press Volume Down. Pressing Volume Down at 18/30 will reduce it to 17/30, but then any subsequent Volume Down presses will decrement by two.
This is annoying, though it does seem to explain why I was fairly easily able to find a happy median volume on my Nexus S with 15 volume steps, but never quite was able to on the GN without a lot of ****ery. Because when I'm pressing the damn volume keys, it's not always only incrementing by one! >.<
Though now with the 30-step volume applied, the "skip two" effect is basically nullified. Still, I'd like it to work properly.
Click to expand...
Click to collapse
I will try and look into it later today when I get home. I will take a look at the source and see if any other values control the increments.
Sent from my Galaxy Nexus using xda premium
tristan202 said:
I will try and look into it later today when I get home. I will take a look at the source and see if any other values control the increments.
Sent from my Galaxy Nexus using xda premium
Click to expand...
Click to collapse
Just wanted to let you know that before you start plowing through a lot of code, the "skip a step" volume key bug is related to a mod included in the ROM I'm using, the mod that allows you to skip tracks by long-pressing the volume key while the screen is off.
Disabling that functionality immediately restored the volume keys to normal.
synaesthetic said:
Just wanted to let you know that before you start plowing through a lot of code, the "skip a step" volume key bug is related to a mod included in the ROM I'm using, the mod that allows you to skip tracks by long-pressing the volume key while the screen is off.
Disabling that functionality immediately restored the volume keys to normal.
Click to expand...
Click to collapse
Nice to know. Took a look at the AudioService.java file yesterday, but couldn't find anything that could explain the behaviour.

On/Off Button Placement

Anybody else bugged by the fact that they put the on/off button, like, the least reachable place on the phone?
I always have to juggle the phone around in my hand to reach the button, and then I have to juggle it back to reach the unlock ring. I mean, the two things I do most, pressing the on button and then sliding the unlock ring, are placed as far apart as possible. It's oddly cumbersome for such an elegant device. It's just a matter of time until I drop the damn thing. (I guess that way HTC sells more replacement screens... )
The volume buttons are where my thumb is, but I never use them. They are mostly in the way and I press them more by accident than on purpose.
Any idea whether there's a way to switch the on and volume buttons? There's probably no mod that can currently do this, but is this technically possible?
That is where the purpose of volume button to wake comes in handy. And yes, it is possible to do that.
Naah... not with me..
Yes it was a little bit difficult... but now I've become used to it....
there's a a mod for that
volume buttons to wake up the phone
use rc 3.0 or else search its thread
ckpv5 posted a long time ago
ummm... try searching -apm+ volume to wake
Sent from my HTC One V
I am using the volume wake thingie. But it will, you know, change my volume setting if I listen to any audio. Which I do a lot.
Also, you can't lock the phone with it. Which precludes my main use of the button: unlock phone, check clock or notifications, lock phone.
Anyways, I wondered about the technical possibility of just switching the buttons.
BirthdayDog11 said:
I am using the volume wake thingie. But it will, you know, change my volume setting if I listen to any audio. Which I do a lot.
Also, you can't lock the phone with it. Which precludes my main use of the button: unlock phone, check clock or notifications, lock phone.
Anyways, I wondered about the technical possibility of just switching the buttons.
Click to expand...
Click to collapse
paresh kalinani pls change your signature
the diffrent colours + size is hurting my eyes
@birthdaydog lolss..i wanted the volume keys to be the camera key just when we start the cam as to click self photos easily
quite diff to click self by touching screen
paarthdesai said:
@birthdaydog lolss..i wanted the volume keys to be the camera key just when we start the cam as to click self photos easily
quite diff to click self by touching screen
Click to expand...
Click to collapse
Well, then there is public interest in finding a way to mod the keys, right?
Try a two second timer.
I have somewhat large hands, and the placement doesn't bother me. I can reach the button with my index finger and reach the ring with my thumb.
I do really miss having an external camera button.
yeah its not too much of a problem for me. i can hit the power button, and then use the unlock ring, but it requires a bit of stretching. i dont have to move the placement of the phone in my hand though.

[Q]How to modify Home Button function in Sleep mode

Is there a way to modify the function of the HOME BUTTON so it doesn't wake the phone?
My Arc S keeps on unlocking inside my pocket and takes a lot of snapshots and drains the battery.
And another thing, what variable to use to open RECENT APPS via a hardware key, for example the camera shutter key.
Thanks in advance.
To prevent screen from turning on in pocket, disable the feature, which turns on screen via home button. Will post instructions later.
Sent from LT18i with custom firmware by myself.
Someguyfromhell said:
To prevent screen from turning on in pocket, disable the feature, which turns on screen via home button. Will post instructions later.
Sent from LT18i with custom firmware by myself.
Click to expand...
Click to collapse
Would really much appreciate it, I've been tormented by this accidental unlock in pocket and drains my battery because of the camera.
Thanks in advance.
Oh, and about the other thing, is it possible? What if I substitute the RECENT APPS for the MENU BUTTON, would the 3dot option appear on some apps?
Someguyfromhell said:
Will post instructions later.
Click to expand...
Click to collapse
Take a file explorer, that can access root folders (ES File Explorer for example), make sure to go into settings and allow access and write to system folders.
Then go to /system/usr/keylayout, open the file pm8058_keypad.kl with ES File Explorer's default Note Editor (long press, Open As, Text), find this line
Code:
key 102 HOME WAKE_DROPPED
and change it to
Code:
key 102 HOME
So just remove the WAKE_DROPPED part.
Wrote it from my head, might have mistakes. Hopefully not.
EDIT: About the recent apps, this is coded somewhere in framework, I can't help you with that. However, the on-screen buttons do not show Menu button, it will only appear on the right side, if there is an app, which makes use of the Menu button and no other possibilities are available (depends on how the app is built).
Thanks a lot for the help sir.
It did the trick and the HOME BUTTON doesn't wake the phone from sleep.
Really much appreciated help.
Thanks again.
I have another question sir, How can I assign the WAKE function in some other button, let's say the VOLUME DOWN?
I tried replacing the WAKE with WAKE_DROPPED but it didn't work, I tried adding it without removing the WAKE and failed.
So is there a way for this?
Thanks again in advance sir.
This particular problem is the reason I use a lock pattern, not because of the security of my phone, but because of the many photos my pocket takes. However, it would be nice if we could wake the phone using the volume rockers, just not to abuse the power button. I also tried to place WAKE_DROPPED on such buttons with no success, help pretty please
Actually I was looking for a mod to use the proximity sensor to know when it is in the pocket, and not allowing the menu button to wake the handset, but this is way better, thanks pal :highfive:
-----------------------------------
Edit:
I found out that the volume rockers actually work well waking the screen, but, you have to select in security>Screen Lock>None
In such case the volume rockers will work to wake the phone (no need to add anything to the VOLUME DOWN line, as it already says WAKE)
Now the question is how to change it to do it while having slide, pattern or password as screen lock
Yeah, that's what I'm after. Using the Volume Rocker to function like the HOME Button in waking the phone.
Will someone help us out in customizing this. The POWER BUTTON is pretty far for my fingers, and the VOLUME DOWN sits just right under my thumb when holding the phone.
Would really much appreciate it if someone help us out.
Maybe they can include something like this on custom roms, giving the users the option to pick which would they prefer.
ajaydsantos said:
Yeah, that's what I'm after. Using the Volume Rocker to function like the HOME Button in waking the phone.
Will someone help us out in customizing this. The POWER BUTTON is pretty far for my fingers, and the VOLUME DOWN sits just right under my thumb when holding the phone.
Would really much appreciate it if someone help us out.
Maybe they can include something like this on custom roms, giving the users the option to pick which would they prefer.
Click to expand...
Click to collapse
It is already on some custom ROMs.
CyanogenMod/FXP based and MIUI ROMs, if I am not mistaken.
But I'm using Zelly Cream 2.5 and it doesn't have that. Hope that it can be ported to this rom.
How do i do it if it's possible? I don't have the know how on such programming/language, will someone help me.
Hi, I have my xperia arc s also with the same problem with you... i actually downloaded root explorer and i can navigate the system data/files but i cannot modify the files mentioned the HOME WAKE_DROPPED... because my unit is not a rooted one...
Please help me to disable the home button by not rooting my phone... Can you make an APK file to disable this function? please please help

Categories

Resources