Use Hardware Key Patterns as Trigger

Post your questions and help other users.

Moderator: Martin

Post Reply
nabla
Posts: 8
Joined: 31 Oct 2013 09:53

Use Hardware Key Patterns as Trigger

Post by nabla » 09 Jul 2015 10:26

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... :)

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Use Hardware Key Patterns as Trigger

Post by Martin » 10 Jul 2015 08:49

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

nabla
Posts: 8
Joined: 31 Oct 2013 09:53

Re: Use Hardware Key Patterns as Trigger

Post by nabla » 21 Jul 2015 08:19

Hm what a pity, I cannot find it either :(

bogdyro
Posts: 241
Joined: 04 Apr 2015 15:14

Re: Use Hardware Key Patterns as Trigger

Post by bogdyro » 13 Sep 2015 10:38

Hi. Did you ever find out how to use the hardware buttons as triggers? Could you please share ?

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Use Hardware Key Patterns as Trigger

Post by Martin » 15 Sep 2015 12:50

Here's a discussion about getevent to get the volume keys:
BUTTON Pressed-Trigger

Post Reply