...but how do I make it to also pause the VLC?
...that's easy
(well, sorta), but wasn't part of the original request...before you just said "minimize VLC".
It's also better for this hotkey to start every time I execute VLC...
...this part is a little hard. I do know of a way to do it (maybe a couple ways), but it's a little overkill for this. It's easier to manually run the Hotkey script whenever you need it, or set it to start with Windows & leave it running.
...and only applied when VLC window is active...
...this part's easy & I even thought about writing it that way, but I thought since it was a "Boss Key" you wouldn't wanna push it & have it "not work" cuz VLC wasn't active. If VLC being active is an OK requirement, that's fine & easy to code.
New code...
Code: Select all
#SingleInstance force
SetTitleMatchMode, 2
#IfWinActive VLC media player
F9::
Send, {Space}
WinMinimize
return
#IfWinActive
...for consistency in my posts, I left the Hotkey on F9, but of course you can change it to comma again.
Also, lemme explain the code a little
(or a lot!), when you press the Hotkey, it sends a Space bar press to the active window (which is VLC, due to the Hotkey only triggering when VLC's active). In VLC, pressing Space will Play/Pause, so essentially, it "Pauses" VLC (but if VLC is not playing it will start playing). Unfortunately, last I tried to look, VLC doesn't seem to have any WinAPI SendMessage/PostMessage API/interface...yes, it does have libVLC & http & telnet (& every OTHER type of interface), but I can't find a simple "windows message" to send to VLC for Pause (or anything else), like VLC_PAUSE or something...if I could, I'd replace the Send with a SendMessage & send a Pause-only message to VLC.
However, you can overcome this: set a "Pause-only" Hotkey in VLC's prefs, then change the script to send
that key instead of Space. For example, if you set your Pause-only Hotkey to period (.), then you'd change the code to "Send, ." instead of "Send, {Space}". But, if you only ever use the Boss Key with VLC playing & active, you won't have a problem, since in that case, Space will always Pause.
I may have over-explained that, but I just wanted you to be aware that if VLC is active &
not playing, pressing the Boss Key would
start playing (due to the nature of pressing Space) & then minimize VLC. I know that's undesirable behavior, but I can't detect VLC's playing/stopped state (except perhaps the presence/absence of a song title in the titlebar?), nor can I send a "Pause-only" command (cuz I can't find a "message" for it), without you making a pref change.
"why the f*** do i need a google+ account to comment on a video?" — jawed (2013) (about YouTube's new requirement of Google+)
youtube.lua — Play YouTube videos in VLC!
Updated: Thu, Jan 15, 2015 --- 1/15/15, 7:19:19pm EST
forum.videolan.org/viewtopic.php?f=29&t=111977&p=379147#p379147
Sigh, the above can't be a link: "You cannot use certain BBCodes: [url]."...so, I can't even link back to a post on this forum?
How about this: can long-term/trusted users be allowed links in sigs?