[Q] Tasker help needed - General Questions and Answers

I have found an app "Home2 Shortcut" that will allow me to double tap my home button to trigger a app or shortcut. I have created a Tasker task (and exported to a app) that sets the media volume to 5 when my home button is double tapped.
I would like to be able to double tap the home button and have the media volume adjusted based on the current volume. So for example if its less than 5 set to 15. If its less than 15 set to 5. And if its equal to 15 set to 5. I have played around with the "IF" variables but I not a programmer and need some help. THANX!

Maybe this can help:
http://tasker.wikidot.com/fadeintask

post-mortem said:
Maybe this can help:
http://tasker.wikidot.com/fadeintask
Click to expand...
Click to collapse
Found what I need here:
https://groups.google.com/forum/#!searchin/tasker/help$20needed/tasker/AMg2U6zZG1s/NnC9s2FWzZEJ
THANX!!

Related

Popup Clock when button is pressed?

Does anyone know if there's a popup clock that would display for 1-2 seconds when a button is pressed and would shut of the screen after that. Like the one found in Palm Tungsten T's?
I know a tool that does the reverse - ae button plus has a function to display a clock for a few seconds when switch on.
HI, this sounds pretty simple to me, just having a clock program, (i do have on I made on my phone (actually very simple c# script) but i am at work at the mo, will upload it when management leave )
But with just this simple clock, i could easily add a timer, which would close the app after a couple of seconds. Job Done?
I'll get on it later tonight, when i get home.
Hmm, just loaded the app on my new phone, turns out you need the .NET compact framework, maybe i will remake a similar app in C++ when i can be arsed , but for now i will modify it to close after a couple of seconds. and if you dont midn the fact it need .net then it will work for you just fine
providence said:
Does anyone know if there's a popup clock that would display for 1-2 seconds when a button is pressed and would shut of the screen after that. Like the one found in Palm Tungsten T's?
Click to expand...
Click to collapse
Very easy to do with MortScript http://www.sto-helit.de/
Code:
utime=FormatTime("h:i A")
SetMessageFont(24)
SleepMessage(5,utime,"Time")
ToggleDisplay(False)
Plus you can customize it to suit your style. Be warned, MortScript can be addictive.
cool. can anyone create this small program?
Something kinda like S2U2, spb Time, or spb Mobile Shell's Now Screen... They all have a clock display on device wakeup.
yeah but what about when im just checking the time? I dont want to press powerup and power off just to check time. just press 1 button and it will auto shut off after 2 sec is better
I think vijay did something like this
providence said:
yeah but what about when im just checking the time? I dont want to press powerup and power off just to check time. just press 1 button and it will auto shut off after 2 sec is better
Click to expand...
Click to collapse
You can see the time displayed in the taskbar in every program by tapping start menu/settings/system bar/clock/ tap "more" at bottom, check box. or you can install this zip, and map it to a hardware button. Mine is mapped where the messaging button is. You need visual basic runtime installed before the clock will work.
hotdog53 said:
You can see the time displayed in the taskbar in every program by tapping start menu/settings/system bar/clock/ tap "more" at bottom, check box. or you can install this zip, and map it to a hardware button. Mine is mapped where the messaging button is. You need visual basic runtime installed before the clock will work.
Click to expand...
Click to collapse
You control the clock talking by tapping anywhere in the center. To close the program, you need to tap the ok button in the taskbar.
hotdog53 said:
You control the clock talking by tapping anywhere in the center. To close the program, you need to tap the ok button in the taskbar.
Click to expand...
Click to collapse
Or you may want to install this zip file and map it to a hardware button. This is actually an alarm clock, but does'nt have to be used as one.
hotdog53 said:
Or you may want to install this zip file and map it to a hardware button. This is actually an alarm clock, but does'nt have to be used as one.
Click to expand...
Click to collapse
Clock shows the actual time with sweep second hand movement. Like wearing a wrist watch.
thanks but not quite the solution im looking for.
would be nice if we can check the time with 1 button and will shut off the screen after 2-3 secs

[APP+DRV] [Keys remapper] Topaz Keyboard Controller GSM v1.4

This is for Topaz only! Do not try to install this on other devices!
Do not ask me to make a version for other device since my remappers are driver dependent and this can be very and very complicated without real device (if possible at all).
By requests of Topaz owners... here you are
What is it ?
It's a solution that allows you to remap ALL keys of your device.
Any key (yeah, i mean ANY, including Home and Back keys) can be reassigned to perform desired actions.
Features:
Different event types supported: single, double and triple clicks, long presses
Two modes of key mapping: three actions per key or direct key mapping
Key repeats in direct key mapping mode
Actions sequence repeats in actions mode
Key combinations using FN modifier
Default key behaviour action - you won't loose key's default behaviour if you just want to add double click or long press to it
Different key behaviour depending on foreground process/window class/window text
Multiple rules for each key to provide different behaviour for each application you want
Multiple actions for each event
Different predefined actions:
Run program
Key press emulation
Send symbol/text to active window
Close active window
Switch to window by class/text
Terminate data connection
Wi-Fi toggle
BT toggle
Screen rotation
Power management (screen power toggle, suspend, reset)
Exceptions lists which are used to deny key remapping depending on foreground process/window class/window text
Configurable long press and double click duration
Configuration import/export in configurator
Changelog is located here.
Configurator UI localization support information is located here.
Requirements:
- .NET CF 2.0 (for configurator app)
Installing:
- Install SdkCerts.cab
- Install TopazKbdControl_XXX.cab
- Soft reset
- Check if keyboard works by pressing hardware buttons and seeing if they do their work, if not - uninstall cab, this wouldn't work on your current ROM (PM me if you still want this to work on your device)
- If it works - go to the control panel and find "Keyboard Config" on a System page
How to define key processing:
- Run configurator (Control Panel -> System -> Keyboard Config)
- Press Menu -> Add key
- When dialog asking you to press key appears press and release desired key
- Set up needed options in key setup dialog and press OK (left softkey)
- In configurator's main window press left softkey "Update settings" to let new configuration take place (reboot is not needed, coz new settings will work immediately after saving)
Backup before installing of modified driver is strongly recommended.
Be careful when downloading the cab, make sure you choose the correct version suitable for your device.
Raphael's version thread here and Rhodium's one here.
CDMA owners can try to install GSM version, but i'm not responsible for any damage given to you device or information stored in it. Maybe there will be version for CDMA devices if GSM one wouldn't work.
Thank You one More Time!
tarkim, Thank you one more time for This Cool Program!
Alex from 4pda
tarkim said:
By requests of Topaz owners... here you are
Raphael's version thread and changelog here and Rhodium's one here.
Click to expand...
Click to collapse
Hi and congrats !
Do you think this app+drv could work on GSM Blackstone ???
Thx in advance
lezink said:
Hi and congrats !
Do you think this app+drv could work on GSM Blackstone ???
Thx in advance
Click to expand...
Click to collapse
nope
this version is only for Topaz since it contains its keypad driver which is hardware dependent
besides making a version for Blackstone is more complicated - it has four touch keys which are handled by other driver, not keypad one
don't think i can help with this without real device
There's an app (mobile magic) that allows to remap nearly all button (except home). Maybe this could be of any help.....
BTW, thanks for fast answer.
NICE NICE NICE
So welcome to the Topaz. A donation is on its way
Hey man
Get a PayPal please - a lot easier to donate
Core Player compatibility?
Hi, its very fine app I must say, thank you!
Unfortunately I can't get it to work with Core Player (I want to map VOL_UP/VOL_DOWN with forward/back). It seems that CorePlayer has some other way to recognize keypresses, in normal situation, there is standard HTC volume screen, and when I change CorePlayer's option "Capture all buttons (like games)" it is better (eg. no volume screen) but it sees no difference no matter if I change behaviour of key or not. It maps VOL_UP and VOL_DOWN as #E5. However, there is application which works good with Core Player, it is VolDpad (http://forum.xda-developers.com/showthread.php?t=552947) - it is different keyboard remap technique?
adek23 said:
Hi, its very fine app I must say, thank you!
Unfortunately I can't get it to work with Core Player (I want to map VOL_UP/VOL_DOWN with forward/back). It seems that CorePlayer has some other way to recognize keypresses, in normal situation, there is standard HTC volume screen, and when I change CorePlayer's option "Capture all buttons (like games)" it is better (eg. no volume screen) but it sees no difference no matter if I change behaviour of key or not. It maps VOL_UP and VOL_DOWN as #E5. However, there is application which works good with Core Player, it is VolDpad (http://forum.xda-developers.com/showthread.php?t=552947) - it is different keyboard remap technique?
Click to expand...
Click to collapse
can use explain how you configured vol up and vol down keys ? or post your config here please
in any case you should use direct key mapping mode with Left and Right key codes for VOL_DOWN and VOL_UP keys resrectively, and don't forget to turn on key repeat for each of them - in this way you will get desired forward and back in CorePlayer
Martinhdk said:
Hey man
Get a PayPal please - a lot easier to donate
Click to expand...
Click to collapse
no way to use paypal for donations - it doesn't allow to pay to my country
i hope your girlfriend use a touch HD someday and you make her a driver
the home button on touch hd is useless from now
vua777 said:
i hope your girlfriend use a touch HD someday and you make her a driver
the home button on touch hd is useless from now
Click to expand...
Click to collapse
First, how are you going to get somebody to help you with your problem, acting like that?
Second, if you installed this on a Touch HD, you are to blame yourself. This is for Topaz, not Blackstone. It clearly says for Topaz in post 1 and it says NOT for Blackstone in post 4.
Third, I'd be VERY surprised if this can not be solved. Tried uninstalling the app and soft-reset? In worst case a hard reset should sort this out.
I've installed this software and i've tryed to remap volum up/ down to page Up/down.
I've chose process and put the name of the aplication but it doesn't work, the volume up/down stop working and in the app the down / up doesnt work.
I have 2 actions 4 each key one * wich does nothing and a new one that i've created.
please help.
thanx.
franklopez said:
I've installed this software and i've tryed to remap volum up/ down to page Up/down.
I've chose process and put the name of the aplication but it doesn't work, the volume up/down stop working and in the app the down / up doesnt work.
I have 2 actions 4 each key one * wich does nothing and a new one that i've created.
Click to expand...
Click to collapse
more info please, more info...
post your config here
you have GSM or CDMA device ?
have you tried to use other settings ?
other keys continue working even after remapping ?
franklopez said:
I've installed this software and i've tryed to remap volum up/ down to page Up/down.
I've chose process and put the name of the aplication but it doesn't work, the volume up/down stop working and in the app the down / up doesnt work.
I have 2 actions 4 each key one * wich does nothing and a new one that i've created.
please help.
thanx.
Click to expand...
Click to collapse
Ok, I just tried it myself and it does work. Here is how I've done it.
1 - click menu - add key
2 - press volume up
3 - event = click - action = emulate key press
4 - key = 33 page up
5 - event = long press - action = default key action
6 - click OK
7 - click update config
This way the volume up key will work as page up (I tested this with opera only and reading a news page it worked great) when you click it ONCE and when you do a LONG PRESS it will turn up your volume.
You can repeat these steps for the volume down key and it will work too.
I've just tested this and it works. I haven't tested it within and explorer (let's say total commander) but in opera it works great for scrolling up or down a page.
Cheers!
This is a great application!
Thank you!
One request though:
First to set the context.
I've seen from other threads that (first step) you have to assign the default action to the button and then (second step) re-map the button to your desired function for the desired application.
If you don't do the first step, the respective button will behave as re-mapped for all applications.
Now the problem concerns the button's backlight.
By default, when a button is presses the backlight comes on.
Now, is it possible to disable the backlight function only when using the button in the re-mapped case? (i.e. only for the second step above and not for first step).
The main reason is to avoid draining the battery when using frequently the re-mapped buttons.
lobo81 said:
Ok, I just tried it myself and it does work. Here is how I've done it.
1 - click menu - add key
2 - press volume up
3 - event = click - action = emulate key press
4 - key = 33 page up
5 - event = long press - action = default key action
6 - click OK
7 - click update config
This way the volume up key will work as page up (I tested this with opera only and reading a news page it worked great) when you click it ONCE and when you do a LONG PRESS it will turn up your volume.
You can repeat these steps for the volume down key and it will work too.
I've just tested this and it works. I haven't tested it within and explorer (let's say total commander) but in opera it works great for scrolling up or down a page.
Cheers!
Click to expand...
Click to collapse
now it works, but 4 my application the keys are up /down.
Tanx a lot.
franklopez said:
now it works, but 4 my application the keys are up /down.
Tanx a lot.
Click to expand...
Click to collapse
You're welcome!
Bothkill said:
This is a great application!
Thank you!
One request though:
First to set the context.
I've seen from other threads that (first step) you have to assign the default action to the button and then (second step) re-map the button to your desired function for the desired application.
If you don't do the first step, the respective button will behave as re-mapped for all applications.
Now the problem concerns the button's backlight.
By default, when a button is presses the backlight comes on.
Now, is it possible to disable the backlight function only when using the button in the re-mapped case? (i.e. only for the second step above and not for first step).
The main reason is to avoid draining the battery when using frequently the re-mapped buttons.
Click to expand...
Click to collapse
It really depends on what you want to do with the keys. For example, I've reassigned the back key to single press = open total commander and long press = open pTravelAlarm. So I don't use it as default. In your case, yes you should assign the click = default action and long press = whatever you want.
Cheers.
Bothkill said:
This is a great application!
Thank you!
One request though:
First to set the context.
I've seen from other threads that (first step) you have to assign the default action to the button and then (second step) re-map the button to your desired function for the desired application.
If you don't do the first step, the respective button will behave as re-mapped for all applications.
Now the problem concerns the button's backlight.
By default, when a button is presses the backlight comes on.
Now, is it possible to disable the backlight function only when using the button in the re-mapped case? (i.e. only for the second step above and not for first step).
The main reason is to avoid draining the battery when using frequently the re-mapped buttons.
Click to expand...
Click to collapse
not clear for me what is the problem (or maybe not problem ? ) with default key action
you have to set it for any event if you don't want to loose default key behaviour, this is not strict requirement
about rules:
there is default rule (*) for all applications which is used when no other matching rule is found
key remains unremapped if you select 'do not remap' for this rule (or any other)
if you add rule for particular application and default rule has an option to not remap key, then remapping for that key would work only in this application
hope was clear enough
can't promise anything about backlight at this moment, this is not critical

How to launch a hidden activity?

I'm looking to make a 1x1 shortcut to launch this activity: com.teslacoilsw.widgetlocker.UNLOCK
Does anyone know how I can accomplish this?
Try:
-long press on desktop
-custom shortcut
-enter label name, click on "pick your activity" button
-choose between "Activities" (adw), "Any Cut", etc, then scroll down to the activity you mentioned
Unfortunately It's not in the list, hence the "hidden" in the title
I can see the app's activities, but not this specific one.
Install and run Tasker:
Create new Task
Name it Unlock or whatnot
Add from Misc category "Action Intent"
Action: com.teslacoilsw.widgetlocker.UNLOCK
Target: Activity
(Leave the rest alone)
Click Done to finish setting the Action Intent
Tap the Icon button in the bottom to give it an Icon (to the left of the X)
Click Done to save the Task
Click Apply to save settings and exit Tasker setup
In Widgetlocker Config:
Add Shortcut
Look for the "Task" shortcut from Tasker
Find your "Unlock" task
Click Make Shortcut
Profit. Although it's faster to swipe
khaytsus said:
Install and run Tasker:
Create new Task
Name it Unlock or whatnot
Add from Misc category "Action Intent"
Action: com.teslacoilsw.widgetlocker.UNLOCK
Target: Activity
(Leave the rest alone)
Click Done to finish setting the Action Intent
Tap the Icon button in the bottom to give it an Icon (to the left of the X)
Click Done to save the Task
Click Apply to save settings and exit Tasker setup
In Widgetlocker Config:
Add Shortcut
Look for the "Task" shortcut from Tasker
Find your "Unlock" task
Click Make Shortcut
Profit. Although it's faster to swipe
Click to expand...
Click to collapse
Thanks for this.
Well, no, tapping a single 1x1 button is faster than swiping (hold and drag). But that's not the reason I'm looking to do this. Namely, I don't want to waste a 4x1 row just to unlock when I don't need or want the sliders on either side (I have other widgets that I want to put on my lock screen )
[Edit]: Tasker $$$
Paul22000 said:
Thanks for this.
Well, no, tapping a single 1x1 button is faster than swiping (hold and drag). But that's not the reason I'm looking to do this. Namely, I don't want to waste a 4x1 row just to unlock when I don't need or want the sliders on either side (I have other widgets that I want to put on my lock screen )
[Edit]: Tasker $$$
Click to expand...
Click to collapse
Yes, Tasker costs money. But Tasker can do anything.
Here's a partial list of what Tasker does for me...
Home, Work, Meeting, Sleep profiles... Based on time AND location.
Turns on speakerphone when I'm on the phone and turn it face down
Downloads a zip file of data I want for geocaching daily, unzips it so it's ready to digest
Turns up the volume and backlight when Waze (GPS Nav) is running
Backs up my dcim dir (10 minutes) using rsync, as images sometimes go poof
Pings me at 7:20 that it's time to get out the door with my kid to get her to school
Responds to specially tagged email or sms with info such as GPS location, phone number, last call in and out
Sends the same info above to a fixed number if my phone number changes (SIM gets swapped)
Reminds me if I've missed a phone call every N minutes
Gives me extra notification for important emails so I know to look right away
Uploads my current GPS coordinates to my website every 10 minutes
Backup my SD card over Wifi nightly
That's most of the list I have.. Some people have it read SMS to them while in the car, chime N number of times for the time (coo-coo clock).. Some of these (like back up the SD card) requires more stuff (fixed ssh client, generating keys, rsync, etc) but most of the above are all Tasker. Think of Tasker as a GUI interface to create programs (tasks) that run under specific circumstances (Contexts) that executes about anything in the Android API or beyond (it can use Locale plugins, including the Execute plugin etc..)
I can't imagine Android without it. And in case you're curious, what effect on battery life? None that I've ever measured. When I first started using it I monitored battery life for several days and noticed no increase in usage.
Paul22000 said:
Thanks for this.
Well, no, tapping a single 1x1 button is faster than swiping (hold and drag). But that's not the reason I'm looking to do this. Namely, I don't want to waste a 4x1 row just to unlock when I don't need or want the sliders on either side (I have other widgets that I want to put on my lock screen )
[Edit]: Tasker $$$
Click to expand...
Click to collapse
Just disable the lock sliders in Widget Locker, and enable one of the button unlocks.
EDIT: Ok, I did it. Unfortunately, my method requires "ShorterCut" from the market (paid app) but much cheaper than Tasker. There may be other ways. Here's what I did.
1. Go to WL and add shortcut
2. Select ShorterCut from the shortcut list
3. Select empty shortcut
4. Go to "Edit Intent"
5. In the first field labeled "Action" put:
Code:
com.teslacoilsw.widgetlocker.UNLOCK
6. In the second field labled "Component" type:
Code:
com.teslacoilsw.widgetlocker/com.teslacoilsw.widgetlocker.WidgetLocker
7. Press "Save intent"
8. Edit Shortcut title to whatever you want and change icon to your wishes.
9. Press "Create shortcut"
10. Done
overground said:
Just disable the lock sliders in Widget Locker, and enable one of the button unlocks.
EDIT: Ok, I did it. Unfortunately, my method requires "ShorterCut" from the market (paid app) but much cheaper than Tasker. There may be other ways. Here's what I did.
1. Go to WL and add shortcut
2. Select ShorterCut from the shortcut list
3. Select empty shortcut
4. Go to "Edit Intent"
5. In the first field labeled "Action" put:
Code:
com.teslacoilsw.widgetlocker.UNLOCK
6. In the second field labled "Component" type:
Code:
com.teslacoilsw.widgetlocker/com.teslacoilsw.widgetlocker.WidgetLocker
7. Press "Save intent"
8. Edit Shortcut title to whatever you want and change icon to your wishes.
9. Press "Create shortcut"
10. Done
Click to expand...
Click to collapse
Is it possible to do this with AnyCut?
The fields are Action / Data / Type, and I'm not sure which one to use for the "Component". I got a LauncherPro force close... Weird.
Paul22000 said:
Is it possible to do this with AnyCut?
The fields are Action / Data / Type, and I'm not sure which one to use for the "Component". I got a LauncherPro force close... Weird.
Click to expand...
Click to collapse
Don't think Anycut's that advanced.
EDIT: Just tried with Bettercut, and same thing happened to me as it did to you. Uninstalling that crap.
I might be missing what you are wanting to do, but you just want to press one button to unlock Widgetlocker correct? I have it installed and in Settings/ Buttons & Imputs there is an option to "Back Button Unlock". I have that checked and all i have to do is hit the back button and it unlocks it for me. There is also an option to unlock with the camera button and/or trackball.
ukYfan said:
I might be missing what you are wanting to do, but you just want to press one button to unlock Widgetlocker correct? I have it installed and in Settings/ Buttons & Imputs there is an option to "Back Button Unlock". I have that checked and all i have to do is hit the back button and it unlocks it for me. There is also an option to unlock with the camera button and/or trackball.
Click to expand...
Click to collapse
Yes but I don't want it to unlock accidentally, which is possible if using the "back button unlock" feature. And if you put the timer on it, then it just becomes annoying to unlock.
Paul22000 said:
Yes but I don't want it to unlock accidentally, which is possible if using the "back button unlock" feature. And if you put the timer on it, then it just becomes annoying to unlock.
Click to expand...
Click to collapse
Understandable, but I have never unlocked it accidentally
Sent from my Droid using Tapatalk
sorry to dig up an old thread but what home app are you using, if you are using a third party app like apex or nova you can just put a shortcut on your widget locker screen to launch that app. thats what i was doing for a while.

[TUT] Tasker - Hardware Button Control | Screen Off Media Player [BETA]

WARNING! THIS PROFILE IS IN BETA. DO NOT INSTALL UNTIL YOU HAVE READ BELOW!
Beta
When creating this profile I experienced bootloops and splash-screen freezes. If you are not comfortable with how to restore your device from these states, then please wait until it has been thoroughly tested before applying the profiles and tasks.
Testers
If there are any of you left after reading the above I was unable to totally identify what caused the crashes. I hope that through my own testing I have removed the probable causes, but I cannot promise. Read on if you’re still game and post below to let me know you’re in!
New to Tasker? Download your free trial from here
Theory
Have full media control using your device’s hardware buttons when the screen is off. Normal functionality restored when the screen is on.
Current Shortfalls/Work-in-progress
Fast reboot required to allow for system changes (15 second reboot).
- To my knowledge, system changes require this to take effect. Please tell me if you know different? As a consequence, the profiles take about 25 seconds from start to finish to activate and deactivate.
Hardware keys control media at all times, not just when the screen is off.
- A revert profile currently takes care of this, so it’s still more than usable.
Unable to configure hardware keys to only perform actions on long-hold
- I’m working on this, but I think it may be down to Gingerbread/kernel restrictions?
Unable to get trackpad click to perform an action
- Again, Gingerbread/kernel/ROM restrictions?
Ability to skip music folder commands unknown
- I’m working on this
Pop up menu tasks are ugly
- I’ll sort out a suitable background image and work out how to change the icons.
Preparation
This may look like another mammoth, ball-ache of a tutorial, but it’s pretty simple really – make yourself a coffee and by the time you’ve finished it, you’ll be done.
You must have full root read/write access.
1) Ensure you are running the latest version of busybox free from the Market. Even if your current ROM comes with it preinstalled, the Market version allows for this and will update it according. This is essential, as a probable cause of the bootloops I experienced. Reboot after updating it.
2) Install the Locale Execute Plugin free from the Market
3) Download Button Saviour Root free from the Market. We will be messing with the hardware keys, so if you lose control of them, this application will save you by displaying them on the screen. Have a play with this application and make sure you are fully versed with using it just in case.
4) Nandroid backup after you’ve done the above so you don’t have to reinstall everything again should things go wrong {We will be mounting the system for full write access}.
Installing and Customisation
Basically, we will be creating a file with the media controls in and asking Tasker to overwrite the existing file when we want to use it – simple.
Using a file explorer, create a folder within the sdcard/Tasker folder called ‘mediacon’. Within this folder, create another called ‘orig’. Navigate to
Code:
system/usr/keylayout/
Take a copy of the file bravo-keypad.kl (bravo will be replaced with your device name (unless you have a bravo!)). Paste it in the ‘mediacon’ folder you created. Paste another copy in the ‘orig’ folder. Open the file in the mediacon folder with a text editor on your phone (or alternatively copy/push it to your pc and view it there).
From the .zip file below, view the bravo-keypad.kl file on your pc using an application such as Notepad ++ (download free from here) or a simple text editor (although the layout may be a little confusing).
You’ll need to compare the two and see what the differences are. The most important additions to the bravo-keypad.kl to enable the media actions on the hardware keys are:
Code:
key 139 MENU WAKE_DROPPED
key 158 BACK
key 217 SEARCH
To:
Code:
key 139 MEDIA_PLAY_PAUSE WAKE
key 158 MEDIA_PREVIOUS WAKE
key 217 MEDIA_NEXT WAKE
The hardware key numbers and the remaining content of the file will no doubt be different from device to device, I assume it will also be different betweens ROMs and user settings too. You will need to preserve the remainder of the file.
Please can I ask you to post the contents of this file in ‘code’ tags if you can’t see that someone has done this for your device already. Could you also detail your ROM and Kernel. It will help others to quickly edit the file with the correct settings without scratching their heads too much – community spirit and all of that.
As you can see all we are doing is changing the three hardware buttons (menu, back and search) to perform media controls instead. You’ll need to edit the file in the ‘mediacon’ folder (either on your device or drag/push to your pc and then back again) to reflect this. Make sure you do not change the file in the ‘orig’ folder! Remember, your device may have different key numbers for the hardware buttons, this won’t matter, just edit the ones listed as menu, back and search and not the ones that have a # before them.
So, now you have your edited file done and your original file stored safely. We’re nearly there!
Install the profiles and tasks and make sure they are unchecked until you have edited them for your needs. The Tasker Media Control V1.zip folder contains the following two profiles:
MediaBoot
MediaControl
It contains the following 8 tasks:
ResetMedVar
MediaMenu
MediaContBoot
MediaContOff
MediaContOn
FastReboot
FastBootConfirm
ContState
The triggers for the tasks are:
Device Boot
Headset Plugged
If you currently have any other profiles that load music apps or perform other tasks when the headset is connected, please disable these.
Firstly, open the task MediaContOn. Click on action 4 (execute action) and select edit. You’ll see two mentions of the bravo-keypal.kl. Replace ‘bravo’ with your device name, or alternatively with whatever the original file was named in system/usr/keylayout/ (I assume it is your device name?). You’ll need to press the back button once you’re done.
Secondly, do exactly the same in the task MediaContOff.
Finally, open the task MediaContBoot and alter action number 2 to the music application you use (if you don’t use the stock android player).
That’s it! You’re done!
Terminal Command Information
There will be a number of terminal commands running, to copy and overwrite files which will mount the /system as read/write. This of course always has its risks, so ensure you have that nandroid backup just in case….
In the task FastReboot, there is the terminal command
Code:
Killall system_server
This command is not without its risks too, but it is the only way to avoid a full reboot in order to apply the system changes.
Running the task for the first time.
In the profiles and tasks, two variables are created:
%EARP – This is set to 2 when the headset is connected and 1 when it is disconnected. By removing the headset (%EARP =1), you will trigger the exit task which will begin to revert the media button changes.
%MEDIACONT – It was necessary to create this variable to avoid Tasker reacting to the headset plugged trigger after the reboot and wanting to start copying the files all over again. If %MEDIACONT = 2, Tasker will therefore know you are already controlling the hardware buttons and it will prevent the headset profile running again. The variable is changed to a value of 1, once the button controls are returned to normal. Simple hey…
When testing, sometimes these variables were showing the wrong value, due to the options to ‘cancel’ at various stages of the tasks. Before you connect your headset and run the profiles for the very first time only, you will need to open the task ResetMedVar and click on ‘test’. This will set both values to 1. At any point, if your variables go out of sync, you can repeat this exercise so the headset connected/disconnected will trigger the profile/exit task accordingly.
So, open ResetMedVar and click test to set the variables to 1. Tick the MediaBoot and MediaControl profiles to activate them and apply to exit Tasker. Insert your headset!
You’ll be prompted with the first pop-up asking if you want to active the media controls. Click to activate (it will disappear in ten seconds and cancel otherwise). Shortly after, a confirmation pop-up will confirm the files have been copied correctly. Shortly after that, another pop up will confirm you wish to proceed with the fast reboot. Click to activate and you’re device will reload the system. It should take around 15-20 seconds.
When the device boots back up, the Button Saviour application will be loaded, to ensure you have button control if things go wrong. Pressing the little arrow on the right hand side of the screen will enable a back button that you can press to back out of the screen. You media player should then load. Choose a happy tune (from a folder/album/artist that has more than one song) (not forgetting you can’t use the back button other than on the screen!) and turn the screen off.
Hopefully, search will skip forward a track, back will skip back a track and menu will play/pause the playback. WHOOP!
When you’ve finished testing, switch the screen back on, unlock it if necessary and then remove the headset. Tasker will then perform the above steps again, replace the files back to the original ones before confirming the fast reboot.
15-20 seconds later, hopefully all of your hardware buttons will then perform as normal!
Job done.
Extras
I couldn’t get the trackpad/optical joystick to perform an action on my device. There is an entry at the very end of MediaContOn and MediaContOff after the STOP. These entries copy and reversely delete a curcial-oj.kl file to /system/usr/keylayout/ that is supposed to enable the trackpad to work. Drag these to position 5 if you’d like to test them on your device to see if they work. Let me know!
Credits
localh0st for the curcial-oj.kl file here
Decad3nce for his key remapping guide here
The mass of other threads I read through on XDA to gain the knowledge to do this and the devs of the free apps mentioned above - I'm sure they'd appreciate a donate.
Oh and of course the dev of Tasker! What an application.... (I'm not on commission I promise!)
FAQ
Q) I have many other Tasker questions, can I post them here??
A) To avoid clutter, probably best to use this official Google group
Q) Where can I learn more about Tasker?
A) The manual and Profiles and step-throughs on the Tasker wiki and you’ll be up to speed in no time.
Change Log
Confirming pop up tasks may be removed in V2.
Bugs
Let me know...
Future Changes/Requests
Find another way to apply system changes without the need of fast reboot.
Hardware keys to only control media when the screen is off.
Configure hardware keys to only perform actions on long-hold to avoid 'pocket-presses'.
Get trackpad/optical joystick click to perform an action
Enable the ability to skip music folders and/or directories.
Pop up menu tasks need sprucing up.
Installation Instructions
In menu options/profile data 'Import One Task':
ResetMedVar
MediaMenu
MediaContBoot
MediaContOff
MediaContOn
FastReboot
FastBootConfirm
ContState
In menu options/profile data 'Import One Profile':
MediaBoot
MediaControl
The thanks meter lets me know I'm appreciated!
Heh, looks like Brandall is taking Tasker to new heights.
Nice work mate, but I just have to add something though...
Using this can help, BUT, it can also "cripple" those Tasker scripts you've posted about battery saving.
Using Tasker for zipping files and extracting them loads my CPU to the max, also, anything that uses notifications and file reads/writes does that too, eventually, using more battery...
Using this I can see a situation where some user might just lock/unlock their screen very often and rapidly, this might cause a major stress on the CPU, ultimately, nulling and voiding your battery saving scripts and potentially causing harm to CPU/battery/device.
And in any case, turning the screen on to switch tracks is really not that much of a hassle, for me anyway.
This is how I see it, just my 2cents.
But keep up the good work buddy, you seem to have been able to utilize Tasker to a MUCH greater extent than what I was able to, will definitely follow your posts.
Gramlengo said:
Heh, looks like Brandall is taking Tasker to new heights.
Nice work mate, but I just have to add something though...
Using this can help, BUT, it can also "cripple" those Tasker scripts you've posted about battery saving.
Using Tasker for zipping files and extracting them loads my CPU to the max, also, anything that uses notifications and file reads/writes does that too, eventually, using more battery...
Using this I can see a situation where some user might just lock/unlock their screen very often and rapidly, this might cause a major stress on the CPU, ultimately, nulling and voiding your battery saving scripts and potentially causing harm to CPU/battery/device.
And in any case, turning the screen on to switch tracks is really not that much of a hassle, for me anyway.
This is how I see it, just my 2cents.
But keep up the good work buddy, you seem to have been able to utilize Tasker to a MUCH greater extent than what I was able to, will definitely follow your posts.
Click to expand...
Click to collapse
Hi Gramlengo, I guess I can count you out as a Beta Tester!?
The logcat/zipping entries should be deleted from the other profiles if you aren't analysing them anymore to see what your phone is up to. As you said, you will use much less resource that way (they will be removed in next release)!
I do a lot of running, so being able to skip track through my pocket (without waking the phone) is essential = my motivation for working this out. For me, being in screen off state therefore won't clash with the other profiles... although saving battery power wasn't a consideration in this profile - there is plenty to spare these days The notifications are for testing and user interaction - I don't use them in my profile, it just overwrites the file and reboots...
I'm running out of ideas for the next profile, I'm open to suggestions! Good to hear you're following my posts, I'll look forward to your feedback - now sign up for this beta, you know you want to....!
Heh, I'd love to be beta testing your ideas!
Gramlengo said:
Heh, I'd love to be beta testing your ideas!
Click to expand...
Click to collapse
Looks like you might be alone there!!
Alright, finally got a time to test this one:
First, I plugged in my headset and got the two pop-up questions which I clicked activate on. Then, nothing happened. After about 10-15 seconds I got a superuser request for the locale execution plugin which i clicked allow and remember my choice on. Still nothing happened. After another 10-15 seconds I got another superuser request from busybox and quickly after a superuser request from locale execution plugin, both which I clicked allow and remember my choice on.
Then the phone finally fast-rebooted. When it was back up and fully loaded, the music application started. I started a tune, switched off my phone screen, and clicked the back button, nothing happened. I clicked the search button, nothing happened. I turned the screen back on, and hey, the back button still functioned as a back button, and the search button still worked as a search button.
What did I do wrong?
My device is a desire HD running leedroid Hd (latest version and kernel).
Does this have something to do with the Desire HD having capacitive buttons?
Will try again, but this time by remapping the physical volume buttons and the physical power button.
I have also attatched the original keymapping file, and my modified one.
Edit: That didn't work. Opened root explorer to see if the values were right, and they were. I also noticed another keymapping file called "spade-keypad-v0.kl" (without the "). Will try to edit the values in this file to see if that will work.
Edit2: Editing the back,menu and search button in spade-keypad-v0.kl didn't work. Will try to remap the volume and power keys.
Edit3: Ok, two more combinations to test: Editing the capacitive buttons in both files, and afterwards editing the physical keys.
Edit4: No luck, I have attatched the other spade-keypad-v0.kl for you to look at. Hope you can fix this!
torsrex said:
I have also attatched the original keymapping file, and my modified one.
Edit: That didn't work. Opened root explorer to see if the values were right, and they were. I also noticed another keymapping file called "spade-keypad-v0.kl" (without the "). Will try to edit the values in this file to see if that will work.
Edit2: Editing the back,menu and search button in spade-keypad-v0.kl didn't work. Will try to remap the volume and power keys.
Edit3: Ok, two more combinations to test: Editing the capacitive buttons in both files, and afterwards editing the physical keys.
Edit4: No luck, I have attatched the other spade-keypad-v0.kl for you to look at. Hope you can fix this!
Click to expand...
Click to collapse
Appreciate your testing torsrex. Nothing's ever simple is it... Did you fast reboot every time you applied changes to the files?
In the file spade-keypad-v0.kl, did you set them like this:
Code:
key 102 HOME WAKE_DROPPED
key 139 MEDIA_PLAY_PAUSE WAKE
key 158 MEDIA_PREVIOUS WAKE
key 217 MEDIA_NEXT WAKE
Check they had applied with a file explorer first and then fast rebooted?
Let me know!
I checked that the files were changed every time with root explorer. I also tried a normal reboot if the fast reboot didn't work (Did this all the times I had changed a file), and I tried copying the files manually with root explorer.
I tried to change the values of the spade-keypad-v0.kl to what you typed, but that didn't work either. Maybe I should also mention that after I changed the back-key, menu-key and the search-key to media controlls, the home button also won't work.
Does this have something to do with having capacitive buttons and not physical buttons (I think the button turns them self off when I put on the screen lock)?
torsrex said:
I checked that the files were changed every time with root explorer. I also tried a normal reboot if the fast reboot didn't work (Did this all the times I had changed a file), and I tried copying the files manually with root explorer.
I tried to change the values of the spade-keypad-v0.kl to what you typed, but that didn't work either. Maybe I should also mention that after I changed the back-key, menu-key and the search-key to media controlls, the home button also won't work.
Does this have something to do with having capacitive buttons and not physical buttons (I think the button turns them self off when I put on the screen lock)?
Click to expand...
Click to collapse
Ok, sounds like you've been pretty thorough. I knew the set-up would be different device to device, but didn't think it would be difficult to establish how.
I guess all we can do is use an app to discover the changes that need to be applied on your device. Check out ButtonRemapper and after it applies the updates, take copies of the files it has adjusted (assuming the app works for you!). Let me know!
Tried the buttonRemapper application from the market, and It worked! The buttons (menu, back and search) got remapped, but I noticed that the screen needed to be turned on before I could press them (no need to enter any pin code or dragging down the slider, just pressing the unlock button). I have atattched all of the kl-files.
torsrex said:
Tried the buttonRemapper application from the market, and It worked! The buttons (menu, back and search) got remapped, but I noticed that the screen needed to be turned on before I could press them (no need to enter any pin code or dragging down the slider, just pressing the unlock button). I have atattched all of the kl-files.
Click to expand...
Click to collapse
Ok, I'm confused now... I can't see any difference between what you did to what the app has done...? Can you?
When the changes are applied in the app, it must take a copy of the original files it's about to change and store them somewhere. Is there a ButtonMapper folder on the SD card? Perhaps have a look in there when the controls are changed for media? See if there is just one file, or if there's an additional one we haven't considered..?
Then we'll solve the screen off use!
Hm, can't find the backup folder, it isn't on the sd card and it's not in the keylayout folder.
torsrex said:
Hm, can't find the backup folder, it isn't on the sd card and it's not in the keylayout folder.
Click to expand...
Click to collapse
Damn it! I'm going to have a search around and see what I can come up with... I'll be back...
Is your device fine after the fast reboots? That's why I put this as a beta as I didn't know how stable it would be compared to a full reboot...
Using the buttonremapper application, I didn't face any issues. Using the tasker-profiles (editing the files manually) caused the home button, back button, menu button and search button to not function any more and I had to restore a nandroid backup. Maybe you should get the correct setup files for each phone before you take it out of beta
By the way, I sent a message to the developer asking him where the buttonremapper application saves it's backup-files, hopefully I will get a quick answer!
torsrex said:
Using the buttonremapper application, I didn't face any issues. Using the tasker-profiles (editing the files manually) caused the home button, back button, menu button and search button to not function any more and I had to restore a nandroid backup. Maybe you should get the correct setup files for each phone before you take it out of beta
By the way, I sent a message to the developer asking him where the buttonremapper application saves it's backup-files, hopefully I will get a quick answer!
Click to expand...
Click to collapse
Good work! And thanks for testing... I need a lot more volunteers like you for each different device, but I don't see them flocking!
Just got a reply from the developer: "in its data directory in the subdirectory files: /data/data/com.beansoft.buttonremapper/files."
So here you go.
torsrex said:
Just got a reply from the developer: "in its data directory in the subdirectory files: /data/data/com.beansoft.buttonremapper/files."
So here you go.
Click to expand...
Click to collapse
Good work again Sir! I'll take a look at the files and see what else is needed for devices with capacitive buttons (which I'm hoping is the only difference...).
Someone just released a trackpad wake for all AOSP ROMs (without messing with the kernel?) over in the Desire forum, so I'm currently looking at that too...
Always something to do... speaking of which, I need you over here next
So I was bored tonight and thought I'd try and revive this project.
What I've got is still a work in progress, but it basically involves using Buttonremapper to reassign volume_up and volume_down to fast_forward and rewind, then use Tasker's 'state: media button pressed' to forbid any other apps from responding to those two buttons and have them act out Tasker tasks only.
One button is set to play/pause media (if screen is off) and raise volume (if screen is on) and the other set to skip forward media (if screen is off) and lower volume (if screen is on). The end result is almost full media control from hardware buttons without having to look at the phone or take it out of your pocket: use the volume up and down buttons to skip and pause tracks, or press power to turn the screen on and change their function to volume up or down temporarily before reverting back to skip and pause as the screen times out. You don't need to be looking at the screen while this is happening.
The problems at the moment are:
1) While two buttons have effectively been made into four, there are five necessary functions - volume up, volume down, play/pause, next track, previous track. I figured previous track was the least important but it would be nice to have it as well.
2) Normally the volume buttons in Android are context-sensitive, changing media or system or whatever volume depending on where you are. With this they're always assigned to media volume, so you'd need an app like Audiomanager or something to change the volume of other things.
3) Other problems that I haven't realised yet.
One other thing, Tasker's 'state: media button pressed' lets you set both long presses and short presses, but they don't seem to play nice together. I think both the long press and short press tasks activate and conflict when the button is held down, but I haven't had a look at this yet.

Have Tasker Control Touchpad Cursor and/or Simulate Screen Tap?

I have an app I am trying to automate with Tasker, and I need Tasker to move the touchpad cursor and then simulate a left click and/or simply simulate a finger tap on the screen.
Details: The app is the Boston Globe reader, which is a localized version of Press Reader. The app only downloads new issues when it is opened (the "background update" feature is not working for me), and this takes a few minutes, so I am trying to use Tasker to open the app at 5 AM and take a few steps to get the download started. (The download is supposed to start when the app is opened, but this also is not working for me).
Problem is that after a few steps, I get to a screen where I have to touch (or click with the touchpad and cursor) a particular Boston Globe icon. I have been unable to get Tasker to simulate either of those actions.
Strangely enough, if I tap anywhere on the screen, I can then use the cursor keys to select the Globe icon and then press the "Enter" key, but this does not work without the initial "triggering" screen tap with my finger, which I cannot get Tasker to simulate.
All suggestions are appreciated! TIA!
smalis said:
I have an app I am trying to automate with Tasker, and I need Tasker to move the touchpad cursor and then simulate a left click and/or simply simulate a finger tap on the screen.
Details: The app is the Boston Globe reader, which is a localized version of Press Reader. The app only downloads new issues when it is opened (the "background update" feature is not working for me), and this takes a few minutes, so I am trying to use Tasker to open the app at 5 AM and take a few steps to get the download started. (The download is supposed to start when the app is opened, but this also is not working for me).
Problem is that after a few steps, I get to a screen where I have to touch (or click with the touchpad and cursor) a particular Boston Globe icon. I have been unable to get Tasker to simulate either of those actions.
Strangely enough, if I tap anywhere on the screen, I can then use the cursor keys to select the Globe icon and then press the "Enter" key, but this does not work without the initial "triggering" screen tap with my finger, which I cannot get Tasker to simulate.
All suggestions are appreciated! TIA!
Click to expand...
Click to collapse
SOLVED, via Tasker Google Groups:
"Ok, you can try the "Run shell" action with the command "input tap 564 1856" where the numbers are the x and y coordinates of the tap location.
in order to get the correct coordinates, on your device go to Settings -> dev options and turn on "show pointer location" then you can go into your app and tap on the correct location and it will display the x/y coordinates of the tap which you can input on that script."
smalis said:
SOLVED, via Tasker Google Groups:
"Ok, you can try the "Run shell" action with the command "input tap 564 1856" where the numbers are the x and y coordinates of the tap location.
in order to get the correct coordinates, on your device go to Settings -> dev options and turn on "show pointer location" then you can go into your app and tap on the correct location and it will display the x/y coordinates of the tap which you can input on that script."
Click to expand...
Click to collapse
i can i tap and HOLD for a specific ammount of seconds?
joelstitch said:
i can i tap and HOLD for a specific ammount of seconds?
Click to expand...
Click to collapse
Don't know. You would have to determine if Run Shell has a "tap and hold" function. Try asking in Tasker Google Groups: https://groups.google.com/forum/#!forum/tasker
Did you ever find out about the tap and hold request? I am looking for the same solution.
squint said:
Did you ever find out about the tap and hold request? I am looking for the same solution.
Click to expand...
Click to collapse
You can do a long press by using shell script and doing input swipe x1 y1 x2 y2 ms, just make sure that x1 and x2 are the same value and that y1 and y2 are the same value then end with however many milliseconds you want the press to be. For example input swipe 400 700 400 700 300, would do a long press on coordinate 400 700 for 300 ms.
Thank you! That worked perfectly. One thing I did discover is that the "input swipe" command seems to be case sensitive. SwiftKey automatically capitalized "Input" - and it did not work until I made it lowercase.
SparedSquid said:
You can do a long press by using shell script and doing input swipe x1 y1 x2 y2 ms, just make sure that x1 and x2 are the same value and that y1 and y2 are the same value then end with however many milliseconds you want the press to be. For example input swipe 400 700 400 700 300, would do a long press on coordinate 400 700 for 300 ms.
Click to expand...
Click to collapse
I came across this when searching for a way to stimulate a long press with Tasker. I'm trying to stimulate a long press of a volume key, to attach it to a Tasker task, so that I can then assign that task to a swipe using the Wake Gestures app I'm using, so as to bring up Ambient Display in Lollipop. Unless anyone reading this knows of a shortcut I'm missing that will activate Ambient Display in an easier way?

Categories

Resources