Hi,
How to long press home button or volume up/down button or power button of the phone using automagic.
And how to add this function in trigger??
Actually i want to take screenshot by long pressing home key or volume up/down key............
Buttons
Moderator: Martin
Re: Buttons
Hi,
Many devices already support a way to take screenshots by pressing power/volume/home buttons in some way. What device are you using?
Detecting hardware keys is quite difficult and requires a rooted device with command getevent.
Starting with the next version of Automagic you could use a trigger Command Output that constantly checks for button down/up events of the volume and power keys and execute a flow based on this. There are currently some issues in the new trigger Command Output that will be fixed in the next EAP version so I would not try to use this trigger at the moment.
The actual commands to use are very device specific but I can post a short tutorial in the forum to show how this can be done on a Nexus 5 after the new version is released on Google Play.
Regards,
Martin
Many devices already support a way to take screenshots by pressing power/volume/home buttons in some way. What device are you using?
Detecting hardware keys is quite difficult and requires a rooted device with command getevent.
Starting with the next version of Automagic you could use a trigger Command Output that constantly checks for button down/up events of the volume and power keys and execute a flow based on this. There are currently some issues in the new trigger Command Output that will be fixed in the next EAP version so I would not try to use this trigger at the moment.
The actual commands to use are very device specific but I can post a short tutorial in the forum to show how this can be done on a Nexus 5 after the new version is released on Google Play.
Regards,
Martin
-
- Posts: 12
- Joined: 12 Sep 2013 03:57
Re: Buttons
Hi,
And how to long press the home key through action ??
Please give me the command to do the same as i was unable to find it after searching a lot........
Thanx in Advance!!
And how to long press the home key through action ??
Please give me the command to do the same as i was unable to find it after searching a lot........
Thanx in Advance!!
Re: Buttons
Hi,
Argh, I completely misunderstood your post, you want to send the keys and not detect the keys
In this case you might need to use the sendevent command. Here is a starting point: http://android.stackexchange.com/questi ... -sendevent
Some devices also support the command screencap to make screenshots. Following action should work when your device supports this command:
Execute Root Command: screencap -p /storage/emulated/0/screenshot.png
Regards,
Martin
Argh, I completely misunderstood your post, you want to send the keys and not detect the keys
In this case you might need to use the sendevent command. Here is a starting point: http://android.stackexchange.com/questi ... -sendevent
Some devices also support the command screencap to make screenshots. Following action should work when your device supports this command:
Execute Root Command: screencap -p /storage/emulated/0/screenshot.png
Regards,
Martin