@Martin
Can you please add this to your to do list? SET_VOLUME_KEY_LONG_PRESS_LISTENER was added in oreo source code and can be used as trigger with screen off too.
for ref
https://www.xda-developers.com/skip-mus ... s-no-root/
SET_VOLUME_KEY_LONG_PRESS_LISTENER
Moderator: Martin
Re: SET_VOLUME_KEY_LONG_PRESS_LISTENER
Tasker Beta just added it : https://www.xda-developers.com/tasker-l ... s-android/
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Re: SET_VOLUME_KEY_LONG_PRESS_LISTENER
@Martin, would it also be possible to customize the duration of the long-press for the trigger to activate as well?
Using the Hardware Key Event, a key_duration variable was provided. Perhaps the same can be done with this one.
Using the Hardware Key Event, a key_duration variable was provided. Perhaps the same can be done with this one.
Hope my post was helpful
Device: OnePlus 5T running crDroid, rooted with Magisk
Device: OnePlus 5T running crDroid, rooted with Magisk
Re: SET_VOLUME_KEY_LONG_PRESS_LISTENER
The system controls when the Down action is sent to Automagic and I don't see a way to configure this. But you could add a condition to the flow to execute different actions based on variable key_duration for the Up action.
e.g. a condition Expression: key_duration > 1500 to execute subsequent actions only when the duration was longer than 1500ms.
Delaying detection of the down event would also work but it's slightly more complicated since it requires to detect and ignore the down event when the delay is not reached. Something like this might work to execute an action when VOLUME_DOWN is pressed and hold more than initalDelay+500ms:
Flow 1:
-Trigger Volume Long Press Event: VOLUME_DOWN Down
-Action Sleep: 500ms
-Action ...
Flow 2:
-Trigger Volume Long Press Event: VOLUME_UP Up
-Action Stop Flows: Flow 1
I add a TODO item to integrate this feature directly into the trigger.
Regards,
Martin
e.g. a condition Expression: key_duration > 1500 to execute subsequent actions only when the duration was longer than 1500ms.
Delaying detection of the down event would also work but it's slightly more complicated since it requires to detect and ignore the down event when the delay is not reached. Something like this might work to execute an action when VOLUME_DOWN is pressed and hold more than initalDelay+500ms:
Flow 1:
-Trigger Volume Long Press Event: VOLUME_DOWN Down
-Action Sleep: 500ms
-Action ...
Flow 2:
-Trigger Volume Long Press Event: VOLUME_UP Up
-Action Stop Flows: Flow 1
I add a TODO item to integrate this feature directly into the trigger.
Regards,
Martin
Re: SET_VOLUME_KEY_LONG_PRESS_LISTENER
That's the method I'm currently using nowMartin wrote: ↑08 Jun 2019 07:58The system controls when the Down action is sent to Automagic and I don't see a way to configure this. But you could add a condition to the flow to execute different actions based on variable key_duration for the Up action.
e.g. a condition Expression: key_duration > 1500 to execute subsequent actions only when the duration was longer than 1500ms.
Unfortunately, it only works when the screen is on.
So in this case, wouldn't I need a condition to check if Flow 1 is still running?Martin wrote: ↑08 Jun 2019 07:58Delaying detection of the down event would also work but it's slightly more complicated since it requires to detect and ignore the down event when the delay is not reached. Something like this might work to execute an action when VOLUME_DOWN is pressed and hold more than initalDelay+500ms:
Flow 1:
-Trigger Volume Long Press Event: VOLUME_DOWN Down
-Action Sleep: 500ms
-Action ...
Flow 2:
-Trigger Volume Long Press Event: VOLUME_UP Up
-Action Stop Flows: Flow 1
Are you referring to the delay?
Hope my post was helpful
Device: OnePlus 5T running crDroid, rooted with Magisk
Device: OnePlus 5T running crDroid, rooted with Magisk