Remap volume buttons in certain apps?

467 views
Skip to first unread message

Matt

unread,
Jul 27, 2010, 10:20:17 PM7/27/10
to Tasker
Hey Pent,

First of all, thanks for creating a great app. As someone new to
Tasker I have no idea if this is possible, but is there any way to
remap the volume buttons while in certain applications? I'm thinking
specifically of the camera application. I have an Incredible and the
camera button can be a little hard to press, especially when taking
self-portraits, often causing me to inadvertently move the phone
slightly and blur the shot. The volume buttons are much more
accessible and easier to press. I seem to recall the ADC writeup
saying something about the ability to remap buttons, although I could
also see this as something that might not be possible w/out rooting.

Thanks,
Matt

UncleMike

unread,
Jul 28, 2010, 1:27:36 AM7/28/10
to Tasker
Quite a while ago Pent stated that only the camera button can be
intercepted by Tasker and prevented from doing its normal function.
But you may be able to get close to what you're looking for with
something like this:

Profile: Camera Volume
Context: App Camera
Action: Ringer Volume %VOLR_CAM

Profile: Rocker Shutter
Context: App Camera
Context: Variable Set %VOLR
Action: Photo Series Time
Action: Profile Status <Rocker Shutter> Off
Action: Ringer Volume %VOLR_CAM
Action: Profile Status <Rocker Shutter> On

The first profile will store the ringer volume setting when the camera
app starts. The second profile will detect any changes to the ringer
volume (assumed to be caused by the volume rocker) while the camera
app is the current app, take a picture, and restore the ringer volume
to the previous level. I believe it's necessary to disable and enable
the profile within the task to avoid causing another picture to be
taken when the volume is restored.

Of course, if your volume is at the highest or lowest setting already,
and you try to increase or decrease it (respectively), the volume
won't actually change, and no picture will be taken.

I'm currently having a problem detecting changes to that variable
(Pent has been unable to reproduce so far), so I can't test any of
this.

Clymmer

unread,
Jul 31, 2010, 9:26:52 AM7/31/10
to Tasker
UncleMike,

Thanks for the suggestion, but unfortunately, I'm missing some steps
from your instructions...

I think I'm with you on creating the App Camera context with the
action of setting %VOLR_CAM to %VOLR and then creating the
CameraVolume Profile around it. But in the second group, I'm a bit
lost as to which action gets associated with which context. I created
the App Camera context with the first action (just to get it created)
and then I created a Rocker Shutter profile around it. Then I added a
Variable Set event for %VOLR...and realized I had no idea what I was
doing.

Would you mind providing some additional details for a newer user?

C.


On Jul 28, 12:27 am, UncleMike <njcable...@gmail.com> wrote:
> Quite a while ago Pent stated that only thecamerabutton can be
> intercepted by Tasker and prevented from doing its normal function.
> But you may be able to get close to what you're looking for with
> something like this:
>
> Profile:CameraVolume
> Context: AppCamera
> Action: RingerVolume%VOLR_CAM
>
> Profile: Rocker Shutter
> Context: AppCamera
> Context: Variable Set %VOLR
> Action: Photo Series Time
> Action: Profile Status <Rocker Shutter> Off
> Action: RingerVolume%VOLR_CAM
> Action: Profile Status <Rocker Shutter> On
>
> The first profile will store the ringervolumesetting when thecamera
> app starts.  The second profile will detect any changes to the ringervolume(assumed to be caused by thevolumerocker) while thecamera
> app is the current app, take a picture, and restore the ringervolume
> to the previous level. I believe it's necessary to disable and enable
> the profile within the task to avoid causing another picture to be
> taken when thevolumeis restored.
>
> Of course, if yourvolumeis at the highest or lowest setting already,

UncleMike

unread,
Jul 31, 2010, 10:41:46 AM7/31/10
to Tasker
While writing everything below here, I realized that you may be
getting hung up on adding a second context to an existing profile. To
do this, just select the context, and pick "Add" under Context on the
popup menu. For a profile to become active, ALL contexts for that
profile must be true at the same time.

The way the second profile is supposed to work is that if there are
changes to the ringer volume while the camera app is in the
foreground, it should take a picture and then restore the ringer
volume to its previous setting.

With user-defined variables (which %VOLR is not, I'm just giving some
background information), a context of "Variable Set" (an event) will
be triggered whenever the specified variable is set. For user-defined
variables, Tasker is doing the settting, so it's easy for Tasker to
monitor this. For dynamic built-in variables, the same should also be
true. So any time %VOLR changes while the camera app is in the
foreground, Tasker should execute the assigned task.

Unfortunately, monitoring of the %VOLR variable is not working on my
Droid for some reason, so I can't really test this to see if it
actually works as I expect it to.

Pent

unread,
Jul 31, 2010, 10:42:55 AM7/31/10
to Tasker
I'll bow to UM's reply, except to say you can also remap the media
button on the
headset, and that I have some ideas to improve the situation as
regards the
other buttons given time.

Pent

James

unread,
Aug 5, 2010, 6:03:36 AM8/5/10
to Tasker
I'm trying to get the same thing working on my Nexus.


I tried to follow your guide but I was unable to get it working, I
think the problem was with the %VOLR variable.


Is there any chance you could do a step by step walkthrough just so I
can see where I'm going wrong?


It would be much appreciated.


It's annoying that the volume buttons work from within the camera app
as you have to save the state, otherwise it would be a lot easier!
Reply all
Reply to author
Forward
0 new messages