Hardware Key Event Boolean AND

Post your feature requets for new triggers, conditions, actions and other improvements.

Moderator: Martin

Locked
vertigo
Posts: 147
Joined: 28 Oct 2018 00:28

Hardware Key Event Boolean AND

Post by vertigo » 20 Jun 2020 02:53

Currently, the hardware key event trigger operates as an OR, so setting it to trigger with vol up/down causes the flow to trigger when either key is pressed. I would like to be able to make a flow trigger only when both keys are pressed.

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Hardware Key Event Boolean AND

Post by Desmanto » 05 Jul 2020 18:54

AFAIR, there are changes in 1.38 which allow this, but can't be sure. Other way to do it is to use condition execution count with very short timed, example 200 ms.
Hardware key AND.png
Hardware key AND.png (32.84 KiB) Viewed 30965 times
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.

vertigo
Posts: 147
Joined: 28 Oct 2018 00:28

Re: Hardware Key Event Boolean AND

Post by vertigo » 08 Jul 2020 18:08

Thanks! Hopefully you're right and it is added in the new version, which would greatly simplify things, though I suppose it's something that'll only be used once. Anyway, your setup got me on the right track, and I just made a minor modification to make it work better. I added a 2x in 500ms execution count after each key code condition before combining into the 2x count after them. That way, pressing the same volume button twice really fast, as might happen when adjusting the volume, won't trigger it.

Locked