VLC Play/Pause on video-click

Post your working scripts, libraries and tools for AHK v1.1 and older
pureby
Posts: 8
Joined: 08 Jun 2019, 14:07

VLC Play/Pause on video-click

09 May 2021, 11:09

Hello comrades! If anyone wants their VLC Media Player to Pause and resume playback on video-click (like in YouTube or virtually any modern video player), here is a simple script that does just that:

Code: Select all

	#IfWinActive ahk_exe vlc.exe
;		[Play|Pause]
		~LButton::
			MouseGetPos, , , , VLC_control
			if InStr(VLC_control, "VLC video output")
			{
				Send, {Space}
			}
			VLC_control := ""
			Return
	#IfWinActive
	return

(I tknow there is another solution for this using the vlc-pause-click-plugin, however, it involves installation of a plugin and rather non-trivial setup. Also, for some reason this plugin got removed from my VLC every time I updated the player, meaning I had to jump through all the hoops after every update.)

My script simply emulates Space keypress (Play/Pause function in VLC) when left-clicking on the video (but not any other part of the VLC/Windows interface). All other functions of the player (like double-click for full-screen, seeking, full-screen controls, etc) are not effected and work as they should. Enjoy!
User avatar
DataLife
Posts: 447
Joined: 29 Sep 2013, 19:52

Re: VLC Play/Pause on video-click

09 May 2021, 18:22

This works great.

thank you for this...
Check out my scripts. (MyIpChanger) (ClipBoard Manager) (SavePictureAs)
All my scripts are tested on Windows 10, AutoHotkey 32 bit Ansi unless otherwise stated.
pureby
Posts: 8
Joined: 08 Jun 2019, 14:07

Re: VLC Play/Pause on video-click

19 May 2021, 04:30

@DataLife You are welcome! I'm glad other people find this useful ;-)
scriptor2016
Posts: 854
Joined: 21 Dec 2015, 02:34

Re: VLC Play/Pause on video-click

17 Oct 2021, 02:58

Not that it matters, but I just assembled a different approach. I almost forgot how to do this simple task since I haven't even looked at scripting in over a year :(

Code: Select all

~LButton::
sleep, 50
wingettitle, title, A
if title contains - VLC media player
{ 
sendinput {space}
}
else
Return

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: No registered users and 252 guests