Pandora Desktop Hotkeys Enhanced

I noted an issue with my original Pandora Desktop Hotkey script in that the embedded Flash control in the Pandora Desktop app sometimes has a different "control" name. This change in name would _sometimes_ make the script unable to send keys to the control. Here's an updated script that tries to work around this issue by simply sending keys to either of the possible names for that embedded control. Enjoy!


DetectHiddenWindows, On
; Pandora Controls
;Ctrl-Win-Alt-Right Arrow
^#!Right::
IfWinExist, ahk_class ApolloRuntimeContentWindow
ControlSend, WebPluginView1, {RIGHT} ; Next
ControlSend, WebPluginView2, {RIGHT} ; Next
return
;Ctrl-Win-Alt-Up Arrow
^#!Up::
IfWinExist, ahk_class ApolloRuntimeContentWindow
ControlSend, WebPluginView1, {UP} ; Volume Up
ControlSend, WebPluginView2, {UP} ; Volume Up
return
;Ctrl-Win-Alt-Shift-Up Arrow
^#!+Up::
IfWinExist, ahk_class ApolloRuntimeContentWindow
ControlSend, WebPluginView1, {SHIFT}{UP} ; Volume Max
ControlSend, WebPluginView2, {SHIFT}{UP} ; Volume Max
return
;Ctrl-Win-Alt-Down Arrow
^#!Down::
IfWinExist, ahk_class ApolloRuntimeContentWindow
ControlSend, WebPluginView1, {DOWN} ; Volume Down
ControlSend, WebPluginView2, {DOWN} ; Volume Down
return
;Ctrl-Win-Alt-Shift-Down Arrow
^#!+Down::
IfWinExist, ahk_class ApolloRuntimeContentWindow
ControlSend, WebPluginView1, {SHIFT}{DOWN} ; Mute
ControlSend, WebPluginView2, {SHIFT}{DOWN} ; Mute
return
;Ctrl-Win-Alt-Space
^#!Space::
IfWinExist, ahk_class ApolloRuntimeContentWindow
ControlSend, WebPluginView1, {SPACE} ; Pause/Play
ControlSend, WebPluginView2, {SPACE} ; Pause/Play
return
;Ctrl-Win-Alt-Plus
^#!+::
IfWinExist, ahk_class ApolloRuntimeContentWindow
ControlSend, WebPluginView1, + ; Thumbs Up
ControlSend, WebPluginView2, + ; Thumbs Up
return
;Ctrl-Win-Alt-Minus
^#!-::
IfWinExist, ahk_class ApolloRuntimeContentWindow
ControlSend, WebPluginView1, - ; Thumbs Down
ControlSend, WebPluginView2, - ; Thumbs Down
return

Comments

Kaha said…
you might want to add

#SingleInstance, Force
DetectHiddenWindows, On

to the beginning of the script so you don't actually have to have the Pandora window showing when using the controls.
GrOG said…
Actually, that is a good point, I had "DetectHiddenWindows, On" at the top of my script. That seemed to be enough to find the Pandora window. I'll change the script.
Anonymous said…
Hey, thanks for the script that works nicely.

I'd just like to add that for those with "media" keys you can the built in key definitions.

Media_Play_Pause::
Media_Next::
Volume_Mute::
Volume_Down::
Volume_Up::
Unknown said…
I had to make a new script to work with Pandora for me.

I also added support for a Media Keyboard,removed mute and replaced with pause, made the Media Keyboard stop button pause because there is no stop in Pandora.

SetTitleMatchMode, Fast
DetectHiddenWindows, On
#WinActivateForce
; Pandora Controls with Media Keyboard Controls
;Ctrl-Alt-Right Arrow
^!Right::
if WinExist("ahk_class ApolloRuntimeContentWindow") or WinExist("ahk_class" . ApolloRuntimeContentWindow)
ControlSend, ahk_parent, {right} ; Next
return
;Media Keyboard Next
Media_Next::
if WinExist("ahk_class ApolloRuntimeContentWindow") or WinExist("ahk_class" . ApolloRuntimeContentWindow)
ControlSend, ahk_parent, {right} ; Next
return
;Ctrl-Alt-Up Arrow
^!Up::
if WinExist("ahk_class ApolloRuntimeContentWindow") or WinExist("ahk_class" . ApolloRuntimeContentWindow)
ControlSend, ahk_parent, {up} ; Volume Up
return
;Media Keyboard Volume Up
Volume_up::
if WinExist("ahk_class ApolloRuntimeContentWindow") or WinExist("ahk_class" . ApolloRuntimeContentWindow)
ControlSend, ahk_parent, {up} ; Volume Up
return
;Ctrl-Alt-Shift-Up Arrow
^!+Up::
if WinExist("ahk_class ApolloRuntimeContentWindow") or WinExist("ahk_class" . ApolloRuntimeContentWindow)
ControlSend, ahk_parent, {SHIFT}{up} ; Volume Max
return
;Ctrl-Alt-Down Arrow
^!Down::
if WinExist("ahk_class ApolloRuntimeContentWindow") or WinExist("ahk_class" . ApolloRuntimeContentWindow)
ControlSend, ahk_parent, {down} ; Volume Down
return
;Media Keyboard Volume Down
Volume_down::
if WinExist("ahk_class ApolloRuntimeContentWindow") or WinExist("ahk_class" . ApolloRuntimeContentWindow)
ControlSend, ahk_parent, {down} ; Volume Down
return
;Ctrl-Alt-Shift-Down Arrow
^!+Down::
if WinExist("ahk_class ApolloRuntimeContentWindow") or WinExist("ahk_class" . ApolloRuntimeContentWindow)
ControlSend, ahk_parent, {SHIFT}{space} ; Pause/Play
return
;Media Keyboard Play/Pause
Media_Play_Pause::
if WinExist("ahk_class ApolloRuntimeContentWindow") or WinExist("ahk_class" . ApolloRuntimeContentWindow)
ControlSend, ahk_parent, {SHIFT}{space} ; Pause/Play
return
;Media Keyboard Stop (incase you are used to stopping music but theres no "Stop" on Pandora, so we'll pause)
Media_Stop::
if WinExist("ahk_class ApolloRuntimeContentWindow") or WinExist("ahk_class" . ApolloRuntimeContentWindow)
ControlSend, ahk_parent, {SHIFT}{space} ; Pause/Play
return
;Ctrl-Alt-Plus
^!+::
if WinExist("ahk_class ApolloRuntimeContentWindow") or WinExist("ahk_class" . ApolloRuntimeContentWindow)
ControlSend, ahk_parent, + ; Thumbs Up
return
;Ctrl-Alt-Minus
^!-::
if WinExist("ahk_class ApolloRuntimeContentWindow") or WinExist("ahk_class" . ApolloRuntimeContentWindow)
ControlSend, ahk_parent, - ; Thumbs Down
return
Unknown said…
Sorry that was the old one. My current uses CTRL+Media key so that the board can use original bindings like on G Logitech keyboards.

SetTitleMatchMode, Fast
DetectHiddenWindows, On
#WinActivateForce
; Pandora Controls with Media Keyboard Controls
;Ctrl-Alt-Right Arrow
^!Right::
if WinExist("ahk_class ApolloRuntimeContentWindow") or WinExist("ahk_class" . ApolloRuntimeContentWindow)
ControlSend, ahk_parent, {right} ; Next
return
;Media Keyboard Next
^Media_Next::
if WinExist("ahk_class ApolloRuntimeContentWindow") or WinExist("ahk_class" . ApolloRuntimeContentWindow)
ControlSend, ahk_parent, {right} ; Next
else Send, {Media_Next}
return
;Ctrl-Alt-Up Arrow
^!Up::
if WinExist("ahk_class ApolloRuntimeContentWindow") or WinExist("ahk_class" . ApolloRuntimeContentWindow)
ControlSend, ahk_parent, {up} ; Volume Up
return
;Media Keyboard Volume Up
^Volume_up::
if WinExist("ahk_class ApolloRuntimeContentWindow") or WinExist("ahk_class" . ApolloRuntimeContentWindow)
ControlSend, ahk_parent, {up} ; Volume Up
return
;Ctrl-Alt-Shift-Up Arrow
^!+Up::
if WinExist("ahk_class ApolloRuntimeContentWindow") or WinExist("ahk_class" . ApolloRuntimeContentWindow)
ControlSend, ahk_parent, {SHIFT}{up} ; Volume Max
return
;Ctrl-Alt-Down Arrow
^!Down::
if WinExist("ahk_class ApolloRuntimeContentWindow") or WinExist("ahk_class" . ApolloRuntimeContentWindow)
ControlSend, ahk_parent, {down} ; Volume Down
return
;Media Keyboard Volume Down
^Volume_down::
if WinExist("ahk_class ApolloRuntimeContentWindow") or WinExist("ahk_class" . ApolloRuntimeContentWindow)
ControlSend, ahk_parent, {down} ; Volume Down
return
;Ctrl-Alt-Shift-Down Arrow
^!+Down::
if WinExist("ahk_class ApolloRuntimeContentWindow") or WinExist("ahk_class" . ApolloRuntimeContentWindow)
ControlSend, ahk_parent, {SHIFT}{space} ; Pause/Play
return
;Media Keyboard Play/Pause
^Media_Play_Pause::
if WinExist("ahk_class ApolloRuntimeContentWindow") or WinExist("ahk_class" . ApolloRuntimeContentWindow)
ControlSend, ahk_parent, {SHIFT}{space} ; Pause/Play
return
;Media Keyboard Stop
^Media_Stop::
if WinExist("ahk_class ApolloRuntimeContentWindow") or WinExist("ahk_class" . ApolloRuntimeContentWindow)
ControlSend, ahk_parent, {SHIFT}{space} ; Pause/Play
return
;Ctrl-Alt-Plus
^!+::
if WinExist("ahk_class ApolloRuntimeContentWindow") or WinExist("ahk_class" . ApolloRuntimeContentWindow)
ControlSend, ahk_parent, + ; Thumbs Up
return
;Ctrl-Alt-Minus
^!-::
if WinExist("ahk_class ApolloRuntimeContentWindow") or WinExist("ahk_class" . ApolloRuntimeContentWindow)
ControlSend, ahk_parent, - ; Thumbs Down
return
Anonymous said…
How do you compile this script? I don't know a whole lot about compiling. So I don't recognize the language.
Unknown said…
Install autohotkey here -http://download.cnet.com/AutoHotkey/3000-2084_4-10279446.html

Run the script inside of the script manager.
Anonymous said…
Now if only someone would create an AppleScript version.
Unknown said…
OMG, thank you, thank you, thank you!

Just upgraded to Pandora One after a week, partially to get the desktop player. Now I can use my media keys just like I was using iTunes (used Edlebrock's version)...so cool!
Jason said…
I am using Phillip's version for the 2.00 app, and it works great except you might want to add
"DetectHiddenWindows, On"
to the script so it can find Pandora if it is minimized to the system tray. Many thanks to everyone.
Phillip Foose said…
As per jason's request I updated the linked script to set the DetectHiddenWindows, On tip.

Pandora One Desktop Auto Hot Key Script
Brian said…
alright. I'm not a computer programmer, but I know my computer stuff in general. please help me out, what do I need to do with these scripts to get the intended results. Can anyone compile this for me and post an .exe or something? Thanks.
Unknown said…
I had no luck with using either version Grog's script. The macros were executing, but they were not properly controlling PandoraOne. I used Edelbrock's revised script that sends to ahk_parent instead and it worked marvelously.

Thank you to both of you guys for getting me to the desired result :) :)
Unknown said…
I had no luck with using either version Grog's script. The macros were executing, but they were not properly controlling PandoraOne. I used Edelbrock's revised script that sends to ahk_parent instead and it worked marvelously.

Thank you to both of you guys for getting me to the desired result :) :)
Unknown said…
I had no luck with using either version Grog's script. The macros were executing, but they were not properly controlling PandoraOne. I used Edelbrock's revised script that sends to ahk_parent instead and it worked marvelously.

I'm on a 64bit OS, not sure if Adobe has different frameworks for 32/64.

Thank you to both of you guys for getting me to the desired result :) :)

Popular posts from this blog

Using Snapshot Isolation with SQL Server and Hibernate

FreeNAS, CIFS, and user login problems

Official Pandora Desktop and Hotkey Support?