I have cooked up a solution using AutoHotkey. It takes a bit to set up, but it is worth it!
Setup:
Download and install
AutoHotkey_L
Create a new
.txt
file. Rename it to have the.ahk
extension.Right-click the file and select
Edit Script
.Input the following:
#InstallKeybdHook
Save.
Right-click the file again, this time selecting
Run Script
.The script is active as indicated in the Windows tray:
Right-click the tray icon and select
Open
.Press your play/pause key. The keystroke has been logged.
From the menu, select
View > Key history and script info
.Toward the bottom, you will see some information about the recent keystroke. We are interested in the
SC
(Scan Code). In my case, it was122
.Open up Pandora.com in Google Chrome.
Press Ctrl+L to select the Address Bar.
Now, press Tab multiple times until the focus has been moved to Pandora's play/pause button. Keep count! In my case, it took
10
tabs.Right-click the AutoHotkey tray icon and select
Exit
. We are done with the setup!
The Script:
Create and run the following script, in the same manner as Steps #2-6 above. Replace XXX
in the 1st line with your scan code, and replace YY
in the 5th line with your tab count.
SCXXX:: SetTitleMatchMode, 1 WinGet, original, ID, A WinActivate, Pandora Internet Radio Send ^l Send Send WinActivate, ahk_id %original% Exit
Now, when you have Pandora.com open and you press your play/pause key, the script will click play/pause on Pandora.com and return you back to where you were.