0

I've had some success using an autohotkey script* to override the media play/pause key to always control Spotify with the following:

Media_Play_Pause::
WinActivate, ahk_exe spotify.exe
Send {Space}
return

But that of course activates the window.

I tried using

Media_Play_Pause::
ControlSend, , {Space}, ahk_exe spotify.exe
return

instead but it doesn't seem to work.

Any ideas what I'm doing wrong?

* This solves a MS Teams annoyance where it will call the last person you called if you press pause/play

2
  • Hello, you kind of forgot to state your problem here. I assume you want to achieve it without activating the window? You need to clearly specify what you're looking for, best done with an actual question, which "What am I doing wrong?" is not as it provides 0 information and should be avoided here whenever possible.
    – Destroy666
    Commented May 4, 2023 at 12:29
  • Apologies - you're of course right. The activate window not being desireable was just immplied with "But", still. Found the answer & posted below.
    – Brian
    Commented May 4, 2023 at 14:05

1 Answer 1

1

Found the answer:

Media_Play_Pause::
PostMessage, 0x319, 0, 0xE0000, , ahk_exe Spotify.exe
return

Seems to work, sending a WM_APPCOMMAND / APPCOMMAND_MEDIA_PLAY_PAUSE message directly to spotify.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .