Page 1 of 1

Use Hardware Key Patterns as Trigger

Posted: 09 Jul 2015 10:26
by nabla
Hi all,

I think it would be very very helpful to execute flows via the volume and on/off keys.

I tried to start with getting the right key by using getevent and the terminal, but it didn't work well. The trigger was executed "randomly". So I don't exactly know how to write those triggers.

Furthermore I don't know how to write those "key patterns", e.g. "3x vol-up within 2 sec", or "vol-up, vol-dn within 3sec".

I'd really appreciate to get your help since there would be many nice uses for that... :)

Re: Use Hardware Key Patterns as Trigger

Posted: 10 Jul 2015 08:49
by Martin
Hi,

getevent is the only way to detect harware buttons I'm aware of (in some cases trigger Audio Volume or Media Button Event might also work). getevent probably stops to work when the device falls into deep sleep.
I think someone already created a flow to detect key press sequences or media button patterns, unfortunately I could not find the flow anymore. Please try to search the forum.

Regards,
Martin

Re: Use Hardware Key Patterns as Trigger

Posted: 21 Jul 2015 08:19
by nabla
Hm what a pity, I cannot find it either :(

Re: Use Hardware Key Patterns as Trigger

Posted: 13 Sep 2015 10:38
by bogdyro
Hi. Did you ever find out how to use the hardware buttons as triggers? Could you please share ?

Re: Use Hardware Key Patterns as Trigger

Posted: 15 Sep 2015 12:50
by Martin
Here's a discussion about getevent to get the volume keys:
BUTTON Pressed-Trigger