Make space pause Media Player
#1
slekvak
Posted 11 May 2008 - 03:39 PM
I'm trying to make a script which make pressing space pause Windows Media Player. I have made this:
Space::
IfWinActive, Windows Media Player
{
send {Media_Play_Pause}
}
else {
send {Space}
}
return
But I can't get it to work. It works when media player is active (it pauses it), but the "else"-part doesnt work. I get this error: 71 hotkeys have been received in the last 711ms.
Why doesn't it work?
Thanks
#2
Posted 11 May 2008 - 03:43 PM
#IfWinActive, Windows Media Player
Space::Send,{Media_Play_Pause}
#3
Slekvak
Posted 11 May 2008 - 03:50 PM
#4
Slekvak
Posted 11 May 2008 - 03:52 PM
#5
Posted 11 May 2008 - 03:57 PM
GroupAdd,mplayer,Windows Media Player
GroupAdd,mplayer,ahk_class WMPTransition
#IfWinActive,ahk_group mplayer
Space::Send,{Media_Play_Pause}This should now work.
#6
Slekvak
Posted 11 May 2008 - 04:09 PM
#7
Posted 11 May 2008 - 04:12 PM
#8
Slekvak
Posted 11 May 2008 - 04:17 PM
#9
Slekvak
Posted 11 May 2008 - 09:45 PM
GroupAdd,mplayer,Windows Media Player
GroupAdd,mplayer,ahk_class WMPTransition
#IfWinActive,ahk_group mplayer
Space::Send,{Media_Play_Pause}
#f::run firefox
#b::run bitche
#10
Posted 11 May 2008 - 10:09 PM
If you put that as the first few lines then all hotkeys will only work in Media player. Either place the hotkeys below all the rest. Or Use
#Ifwinactive, ; Blank to turn off any limitations.
#11
Slekvak
Posted 11 May 2008 - 10:28 PM
I can't put the media player code at the bottom. Then it doesn't work. If i remove "vahk_group mplayer" from the IfWinActive line as you said, space doesn't work at all when other apps are in focus. What am I missing or not understand?
Thanks
#12
Posted 12 May 2008 - 12:01 AM
GroupAdd,mplayer,Windows Media Player
GroupAdd,mplayer,ahk_class WMPTransition
#IfWinActive,ahk_group mplayer ; All hotkeys from this point only work when media player is active
Space::Send,{Media_Play_Pause}
#Ifwinactive, ; All hotkeys from now on work in any window.
; All other hotkeys
#13
Kandou Erik
Posted 23 January 2011 - 09:58 AM
Please reply soon. Thank you.
#14
Kandou Erik
Posted 23 January 2011 - 02:51 PM
Still, that's very annoying not being able to pause it when the display is up. So - essentially I added the code I found with the code I already knew would pause WMP. This worked for me. I hope it will work for other people. Just copy and paste it exactly into the AutoHotKeys.
GroupAdd,mplayer,Windows Media Player
GroupAdd,mplayer,WMPTransition
GroupAdd, wmp, Windows Media Player
GroupAdd, wmp, ahk_class WMP Skin Host
GroupAdd, wmp, ahk_class WMPTransition
GroupAdd, wmp, FullScreenTopLayout
#IfWinActive, ahk_group wmp
Space::Send ^p
Enter::Send !{Enter}
#IfWinActive
#IfWinActive,ahk_group mplayer ; All hotkeys from this point only work when media player is active
Space::Send,{Media_Play_Pause}
#Ifwinactive, ; All hotkeys from now on work in any window.
; All other hotkeys
#15
lafingman0
Posted 24 February 2011 - 04:07 AM




