| Line 1: |
Line 1: |
| − | ===<p><b>About</b></p>=== | + | <pre class="header-style">The Media Button Pressed trigger fires when the media button on headphones is pressed. This trigger supports detecting multiple press patterns and long presses, allowing you to assign different actions to different press combinations. The trigger registers MacroDroid as a media button receiver to capture these events.</pre> |
| | | | |
| − | <pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
| + | ''' Options ''' |
| − | This trigger will fire when the media button (on the headphones) is pressed between 1-3 times.
| |
| − | </pre>
| |
| | | | |
| − | ==<p><b>Supported configurations</b></p>==
| + | * '''Single Press''' - Fires when the media button is pressed once |
| | + | * '''2 Presses''' - Fires when the media button is pressed twice in quick succession |
| | + | * '''3 Presses''' - Fires when the media button is pressed three times in quick succession |
| | + | * '''Long Press''' - Fires when the media button is held down for an extended period |
| | | | |
| − | <pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
| + | ''' Examples ''' |
| − | Note that some devices such as Xiaomi AirDots may map a double press on the device to the long press option in MacroDroid.
| |
| − | </pre>
| |
| | | | |
| − | * ''''' Single Press'''''
| + | ''Example 1: Play/pause music with single press'' |
| − | * ''''' 2 Presses'''''
| + | |
| − | * ''''' 3 Presses''''' | + | <pre class="trigger-style">Triggers |
| − | * ''''' Long Press''''' | + | |
| | + | Media Button Pressed: Single Press</pre> |
| | + | <pre class="action-style">Actions |
| | + | |
| | + | Control Media: Play/Pause</pre> |
| | + | |
| | + | ''Example 2: Skip to next track with double press'' |
| | + | |
| | + | <pre class="trigger-style">Triggers |
| | + | |
| | + | Media Button Pressed: 2 Presses</pre> |
| | + | <pre class="action-style">Actions |
| | + | |
| | + | Control Media: Next Track</pre> |
| | + | |
| | + | ''' Notes ''' |
| | + | |
| | + | * Device-specific behavior may vary. Some models (like Xiaomi AirDots) may interpret a double-press on the physical device as the long press option within MacroDroid rather than registering it as two separate presses. |
| | + | * For the long press option to work properly, you may need to clear the default app for voice/web search. MacroDroid will prompt you to do this if another app is set as the default. |
| | + | * MacroDroid continuously re-registers itself as the media button receiver every 5 seconds to maintain control, as other apps may take over the media button listener. |
| | + | * The trigger also re-registers when the screen turns on or off to ensure reliable detection. |
| | + | * This trigger works even when the screen is off, as long as MacroDroid is running. |
| | + | |
| | + | ''' See Also ''' |
| | + | |
| | + | * [[Trigger:_Media_Button_V2_Beta]] |
| | + | * [[Action: Control Media]] |
| | + | * [[rigger:_Headphones_Insert/Removed]] |