Page 1 of 1
Power button trigger
Posted: 08 Apr 2016 18:48
by ferda-mravenec
Hello.
I was unable to find a proper answer how to set up a trigger which will fire after long press on power button is registered. I came around with Command Output, but had no luck to set it up ,(
I am running stock 6.0 on LG G4 with root access.
Any help will be appreciated.
Thank you.
Martin
Re: Power button trigger
Posted: 08 Apr 2016 19:25
by Martin
Hi,
On a Nexus following configuration of trigger Command Output works:
Command: while true; do getevent -l -c1 /dev/input/event2; done
select as root
Output trigger condition: matches glob *KEY_POWER*UP*
Unfortunately I don't have a G4 test device. The device (/dev/input/event2) might be a different one like event0 or event1.
Regards,
Martin
Re: Power button trigger
Posted: 09 Apr 2016 12:25
by ferda-mravenec
Works like a charm with event1. Is it possible to stop propagating this event after it is handled by Automagic?
Thank you.
Re: Power button trigger
Posted: 09 Apr 2016 14:04
by MURTUMA
It should not be possible by regular apps. However, there are an Xposed module Xposed Additions which allows you to remap hardware keys. If you are rooted and have Xposed Framework installed, that might be your solution. It has a risk of bricking your device so I will not recommend it any more than saying, it is possible.
Re: Power button trigger
Posted: 09 Apr 2016 17:25
by ferda-mravenec
I already have xposed installed. I will give the module a try. Thanks!