(v2) VLC - click to pause

Get help for the alpha version of AutoHotkey v2 here. Please state the v2 version you are working with in the title when making a new topic.
Posts: 13
Joined: 12 Sep 2019, 20:28

(v2) VLC - click to pause

24 Mar 2020, 14:35

Hey, noob here.
I wanted to make a script to pause a playing VLC video when I click it. Sort of like how YouTube works.
So that would require sending {Space} with a left mouse click,
but only when hovering over the video, not any other part of the UI.

I noticed that when I hover the mouse over the playing video,
the ClassNN changes to ClassNN: VLC video output 00000292D0D9E2801

That last string of digits changes every time,
but the “VLC video output” part doesn't.
Will MatchMode save me in this case?

How would I make a script like this?
I have a feeling this is more complicated than I first thought.
Any help would be much appreciated!
Last edited by robinson on 26 Mar 2020, 04:28, edited 1 time in total.
Posts: 3163
Joined: 09 Oct 2013, 10:31

Re: (v2) VLC - click to pause

25 Mar 2020, 10:16

you can use MatchMode 2 for partial match
or MatchMode regex

Posts: 1
Joined: 14 Jul 2020, 05:40

Re: (v2) VLC - click to pause

14 Jul 2020, 05:58

I just made a simple script that seems to work good for me, inspired by https://autohotkey.com/board/topic/77296-vlc-media-player-left-click-video-to-pauseplay/

Code: Select all

;Left-click on the video in VLC toggles play/pause:

~LButton:: ;VLC window is already active here due to ~ in ~LButton
MouseGetPos _, _, _, ctrl ;Get name of control under mouse pointer
if (SubStr(ctrl, 1, 16) == "VLC video output") ; Is it the VLC video control?
    SendInput "{Space}" ;Play/pause VLC

Return to “AutoHotkey v2 Help”

Who is online

Users browsing this forum: No registered users and 4 guests