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
Power button trigger
Moderator: Martin
Re: Power button trigger
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
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
-
- Posts: 8
- Joined: 26 Aug 2015 09:03
Re: Power button trigger
Works like a charm with event1. Is it possible to stop propagating this event after it is handled by Automagic?
Thank you.
Thank you.
Re: Power button trigger
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.
-
- Posts: 8
- Joined: 26 Aug 2015 09:03
Re: Power button trigger
I already have xposed installed. I will give the module a try. Thanks!