media_play_pause no longer works globally?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
newcod3r
Posts: 505
Joined: 30 Sep 2021, 02:16

media_play_pause no longer works globally?

Post by newcod3r » 23 Dec 2021, 20:34

another simple script that has been working globally, but recently stopped working when I'm on another window, and trying to pause the song playing from Spotify in the background:

Code: Select all

f7::Send {media_play_pause}  ; stop song
is there a windows-related setting that causes this, or a script issue?

User avatar
mikeyww
Posts: 27100
Joined: 09 Sep 2014, 18:38

Re: media_play_pause no longer works globally?

Post by mikeyww » 23 Dec 2021, 21:44

If the same hotkey is already being used elsewhere, it could conflict.

newcod3r
Posts: 505
Joined: 30 Sep 2021, 02:16

Re: media_play_pause no longer works globally?

Post by newcod3r » 23 Dec 2021, 23:05

mikeyww wrote:
23 Dec 2021, 21:44
If the same hotkey is already being used elsewhere, it could conflict.
I just double checked and also used another hotkey to be sure - there's no conflict.

User avatar
Xtra
Posts: 2750
Joined: 02 Oct 2015, 12:15

Re: media_play_pause no longer works globally?

Post by Xtra » 24 Dec 2021, 03:07

You could try:
~f7::Send {media_play_pause} ; stop song
or
f7::media_play_pause ; stop song
~f7::media_play_pause ; stop song

User avatar
mikeyww
Posts: 27100
Joined: 09 Sep 2014, 18:38

Re: media_play_pause no longer works globally?

Post by mikeyww » 24 Dec 2021, 06:03

The original script worked on my system, so I could not reproduce the problem. Does your script work when Notepad is the active window? Does your script work when you close all other running programs (except Microsoft's system processes, Notepad, and Spotify)? If you reboot your computer and run only Notepad and Spotify, does it work then?

newcod3r
Posts: 505
Joined: 30 Sep 2021, 02:16

Re: media_play_pause no longer works globally?

Post by newcod3r » 28 Dec 2021, 04:41

mikeyww wrote:
24 Dec 2021, 06:03
The original script worked on my system, so I could not reproduce the problem. Does your script work when Notepad is the active window? Does your script work when you close all other running programs (except Microsoft's system processes, Notepad, and Spotify)? If you reboot your computer and run only Notepad and Spotify, does it work then?
it only works when Spotify is the active window, but I did NOT put any context to the code.

Same if it is just notepad & spotify. Weird that it works on my other desktop with the exact same code, setup & apps.

newcod3r
Posts: 505
Joined: 30 Sep 2021, 02:16

Re: media_play_pause no longer works globally?

Post by newcod3r » 28 Dec 2021, 04:44

Xtra wrote:
24 Dec 2021, 03:07
You could try:
~f7::Send {media_play_pause} ; stop song
or
f7::media_play_pause ; stop song
~f7::media_play_pause ; stop song
I tried them all but to no avail.

User avatar
mikeyww
Posts: 27100
Joined: 09 Sep 2014, 18:38

Re: media_play_pause no longer works globally?

Post by mikeyww » 28 Dec 2021, 07:18

It sounds like a software conflict of some kind. They can be difficult to find and resolve. Could try something like ^+F7 as the hotkey. If you press the media key manually, it works?

newcod3r
Posts: 505
Joined: 30 Sep 2021, 02:16

Re: media_play_pause no longer works globally?

Post by newcod3r » 29 Dec 2021, 17:54

mikeyww wrote:
28 Dec 2021, 07:18
It sounds like a software conflict of some kind. They can be difficult to find and resolve. Could try something like ^+F7 as the hotkey. If you press the media key manually, it works?
It doesn't too regardless of what hotkey I switch to. I got no media key on my desktop keyboard.

is there any app I can use to detect such conflicts?

User avatar
mikeyww
Posts: 27100
Joined: 09 Sep 2014, 18:38

Re: media_play_pause no longer works globally?

Post by mikeyww » 29 Dec 2021, 20:22

I'm not sure of the best way to go about that, though I do it by closing all other running programs. I'm guessing that some other running program could be interfering. Others here may have some better ideas for you.

f8xct1
Posts: 1
Joined: 22 Jan 2022, 16:04

Re: media_play_pause no longer works globally?

Post by f8xct1 » 22 Jan 2022, 16:07

Just created an account to say that my media_play_pause key stopped working at around the same time as this was posted (around December), so I believe there might have been an update pushed to either the OS or a program during this time that conflicts with the keys functionality.

mborsik
Posts: 1
Joined: 01 Dec 2022, 19:15

Re: media_play_pause no longer works globally?

Post by mborsik » 01 Dec 2022, 19:21

Just made an account to tell you that it's not an autohotkey issue, it's a spotify problem. I've found a solution in this reddit thread:

https://www.reddit.com/r/microsoft/comments/mzfy0p/media_keys_doesnt_work_for_spotify/gw3qyu0/?context=3

However, in my case, the prefs was was located in Users\Username\AppData\Roaming\Spotify

I added the line and restarted spotify:

ui.system_media_controls_enabled=false

Now it works flawlessly.

Post Reply

Return to “Ask for Help (v1)”