| 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 press the volume up or down button on the device. In most cases the trigger will only work when the screen is on (monitoring volume changes works with screen off if the device is awake, e.g., when playing music).</pre> |
| − | This trigger will fire when you press the volume up or down button on the device. In most cases the trigger will only work when the screen is on (Monitoring volume changes works with screen off if the device is awake, eg. when playing music). | |
| | | | |
| − | You can choose to allow the volume to update or retain the previous volume when pressed.
| + | ''' Options ''' |
| | | | |
| − | It is recommended you use this action with constraints, as interfering with the devices volume controls at all times is not recommended. | + | ''' Monitoring Method ''' |
| − | </pre>
| + | |
| | + | * '''Use Accessibility Service''': Monitor volume buttons using the accessibility service (supports more button options including long press) |
| | + | * '''Monitor Volume Changes''': Monitor actual volume changes (works with screen off when device is awake) |
| | + | |
| | + | ''' Button Options (Accessibility Mode) ''' |
| | + | |
| | + | * '''Volume Up''': Trigger on volume up button press |
| | + | * '''Volume Down''': Trigger on volume down button press |
| | + | * '''Volume Up (Long Press)''': Trigger on long press of volume up |
| | + | * '''Volume Down (Long Press)''': Trigger on long press of volume down |
| | + | * '''Volume Up + Volume Down''': Trigger when both buttons are pressed simultaneously |
| | + | * '''Volume Up + Volume Down (Long Press)''': Trigger on long press of both buttons simultaneously |
| | + | |
| | + | ''' Button Options (Monitor Volume Changes Mode) ''' |
| | + | |
| | + | * '''Volume Up''': Trigger when volume increases |
| | + | * '''Volume Down''': Trigger when volume decreases |
| | + | |
| | + | ''' Volume Behavior ''' |
| | + | |
| | + | * '''Retain Previous Volume''': The volume level stays the same when the button is pressed (the press is intercepted) |
| | + | * '''Update Volume''': The volume level changes normally when the button is pressed |
| | + | |
| | + | ''' Permissions ''' |
| | + | |
| | + | * '''Accessibility Mode''': Requires the MacroDroid Accessibility Service to be enabled |
| | + | * '''Monitor Volume Changes Mode''': Requires Notification Policy Access permission on Android 7.0+ |
| | + | |
| | + | ''' Examples ''' |
| | + | |
| | + | <pre class="trigger-style">Triggers |
| | + | |
| | + | Volume Button Pressed: Volume Down (Retain Previous Volume)</pre> |
| | + | <pre class="action-style">Actions |
| | + | |
| | + | Media Control: Skip to Next Track |
| | + | Vibrate: Short Pulse</pre> |
| | + | <pre class="constraint-style">Constraints |
| | + | |
| | + | Music Playing: True</pre> |
| | + | |
| | + | ''Skip to the next track when pressing volume down while music is playing, without changing the volume.'' |
| | + | |
| | + | ---- |
| | + | |
| | + | <pre class="trigger-style">Triggers |
| | + | |
| | + | Volume Button Pressed: Volume Up + Volume Down</pre> |
| | + | <pre class="action-style">Actions |
| | + | |
| | + | Torch: Toggle</pre> |
| | + | <pre class="constraint-style">Constraints |
| | + | |
| | + | Screen State: Screen Off</pre> |
| | + | |
| | + | ''Toggle flashlight by pressing both volume buttons simultaneously when screen is off.'' |
| | + | |
| | + | ''' Notes ''' |
| | + | |
| | + | * In most cases the trigger only works when the screen is on. Monitoring volume changes can work with screen off if the device is awake (e.g., playing music). |
| | + | * It is recommended to use this trigger with constraints, as interfering with the device's volume controls at all times is not recommended. |
| | + | * The "Retain Previous Volume" option is useful when you want to use volume buttons for other purposes without actually changing the volume. |
| | + | * Long press and simultaneous button press options are only available when using the Accessibility Service mode. |
| | + | * Consider using the Volume Button Long Press trigger if you need reliable detection when the screen is off. |
| | + | |
| | + | ''' See Also ''' |
| | + | |
| | + | * [[Trigger:_Volume_Button_Long_Press|Volume Button Long Press Trigger]] |