How to tell Tasker to do some thing when screen is Locked , NOT when screen go OFF

7,256 views
Skip to first unread message

beshoo

unread,
Feb 25, 2012, 8:40:49 PM2/25/12
to Tasker
If you set a Prfile to run when screen go OFF , Tasker will run this
profile when you put the phone on your ear while talking , cos the
screen gos Off , what i need is to run the profile when i lock my
phone !

Pent

unread,
Feb 26, 2012, 4:05:21 AM2/26/12
to Tasker
How about:

Event: Display Off
Wait 1 Second
Perform Task MYTASK If Variable Value %KEYG Matches on

Pent

beshoo

unread,
Feb 26, 2012, 8:13:16 AM2/26/12
to Tasker
Thank you for your reply , but i am sorry , it dos not work at all , i
dont know why
wneh i set

if Variable Value %KEYG Matches on

wne i lock the scran nothing happend

TW

unread,
Feb 26, 2012, 8:20:16 AM2/26/12
to tas...@googlegroups.com
perhaps you need to set the wait a bit longer
in some settings it takes something like 5 seconds for the lockscreen to activate
try setting wait to 10 seconds and see what happens

beshoo

unread,
Feb 26, 2012, 8:25:05 AM2/26/12
to Tasker
i note when i set match " *on* "
it work ... but when wen i put the phone on my ear it work to !

my phone it samsung galaxsy s2
android 2.3.3

UncleMike

unread,
Feb 26, 2012, 9:39:36 PM2/26/12
to tas...@googlegroups.com
I've never used it before, but the %KEYG variable appears to represent whether keyguard is enabled or disabled, not whether it is currently active (requiring a slide to unlock).  To address this type of situation I have three profiles that keep track of the phone state, as documented here.  You can then add a context to your profile, like this:

Context: Variable Value %myPHONE ~ idle

of you can make individual actions conditional based on the value of the same variable.

sayling

unread,
Feb 27, 2012, 1:12:52 PM2/27/12
to Tasker
Not quite... I use '%KEYG matches on' and matches off in a number of
profiles and tasks. The variable is different from the action to
enable or disable the keyguard itself.

However, I suspect the issue is more to do with Android functionality,
as I have been plagued by something similar before, ie when you're in
a call, Android will often enable the keyguard automatically - and,
sadly, I don't think i've yet found a way around this... :(


On Feb 27, 2:39 am, UncleMike <mquin...@metroconnectonline.com> wrote:
> I've never used it before, but the %KEYG variable appears to represent
> whether keyguard is enabled or disabled, not whether it is currently active
> (requiring a slide to unlock).  To address this type of situation I have
> three profiles that keep track of the phone state, as documented here<https://groups.google.com/d/msg/tasker/Armn98tf1S0/g5JaNdMLrHEJ>.

UncleMike

unread,
Feb 27, 2012, 3:45:05 PM2/27/12
to tas...@googlegroups.com
The reason I said that is that I used "Run an action" to Flash %KEYG and the value was on.

armbaru

unread,
Feb 27, 2012, 4:43:30 PM2/27/12
to Tasker
I don't know of a way to check whether or not the phone display is
currently locked, but as a workaround for the specific example you
cited, you might be able to incorporate 'Phone Offhook' and/or 'Phone
Idle' into your profile to keep it from triggering when the display
goes off while you're in a call.

Amer

unread,
Feb 28, 2012, 5:59:38 AM2/28/12
to tas...@googlegroups.com
make another profiles that triggered when
- the phone is unhooked => set a variable to 'yes'
- the phone is idle => set a variable to 'no'

base on these profiles, you can check the variable first before running any task you may have.
--


Be first, be better, or cheat.™
Message has been deleted

Rich D

unread,
Jul 8, 2015, 5:30:56 AM7/8/15
to Tasker Google Groups Post


> 1) Create a profile with an event, -> 'display unlocked'. (At least the latest version has this feature)
>

Ummm, 'dispaly unlocked' is a "Event" context so

(Add->State->tasker->profile active)

Will not work to see if this profile is active because it is only active for a millisecond or so....

Reply all
Reply to author
Forward
0 new messages