Changes

no edit summary
Line 1: Line 1: −
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
+
<pre class="header-style">This trigger will fire when you long press the volume up or down button on the device. Unlike the standard Volume Button trigger, this trigger should fire even when the screen is off.</pre>
This trigger will fire when you long press the volume up or down button on the device. Unlike the standard Volume Button trigger this trigger should fire even when the screen is off.
     −
You can enable this feature to work on non-rooted devices using the adb tool from a connected PC. For full information check
+
''' Options '''
 +
 
 +
* '''Volume Up''': Trigger on long press of the volume up button
 +
* '''Volume Down''': Trigger on long press of the volume down button
 +
 
 +
''' Requirements '''
 +
 
 +
This trigger requires special permissions that can be granted in one of two ways:
 +
 
 +
* '''Root Access''': On rooted devices, the permission is granted automatically when the trigger is enabled
 +
* '''ADB Hack''': On non-rooted devices, use ADB from a connected PC to grant the required permission:
 +
 
 +
<pre>
 +
adb shell pm grant com.arlosoft.macrodroid android.permission.SET_VOLUME_KEY_LONG_PRESS_LISTENER
 
</pre>
 
</pre>
* ''How to grant permissions '' ''[https://macrodroidforum.com/index.php?threads/adb-hack-granting-extra-capabilities-via-the-adb-tool.48/ ADB Hack]''
+
 
 +
''' Configuration '''
 +
 
 +
* Requires Android 8.0 (Oreo, API 26) or higher
 +
* Requires Notification Access permission
 +
* The trigger begins working immediately after the permission is granted (even if you grant it while on the macro edit screen)
 +
 
 +
''' Examples '''
 +
 
 +
  <pre class="trigger-style">Triggers
 +
 
 +
Volume Button Long Press (Volume Down)</pre>
 +
  <pre class="action-style">Actions
 +
 
 +
Torch: Toggle
 +
Vibrate: 100ms</pre>
 +
 
 +
''Toggle flashlight with a long press of volume down, even when screen is off.''
 +
 
 +
----
 +
 
 +
  <pre class="trigger-style">Triggers
 +
 
 +
Volume Button Long Press (Volume Up)</pre>
 +
  <pre class="action-style">Actions
 +
 
 +
Media Control: Play/Pause
 +
Vibrate: 50ms</pre>
 +
  <pre class="constraint-style">Constraints
 +
 
 +
Screen State: Screen Off</pre>
 +
 
 +
''Control media playback with a long press of volume up when the screen is off.''
 +
 
 +
''' Notes '''
 +
 
 +
* This trigger uses a private Android API that could potentially be blocked in future versions of Android or by future MacroDroid updates.
 +
* A warning is displayed when first adding this trigger to inform users about the private API usage.
 +
* Unlike the standard Volume Button Press trigger, this trigger works reliably even when the device screen is off.
 +
* This is particularly useful for pocket operation scenarios.
 +
 
 +
''' See Also '''
 +
 
 +
* [[Trigger:_Volume_Button_Press|Volume Button Press Trigger]]