Simulating fast forward and rewind in VirtualDub using Autohotkey

Virtualdub does not have a dedicated fast-preview option. The only way to fast-preview, without giving up on normal preview, is to hold down the arrow key. I find this a little inconvenient and slow.

Here is an Autohotkey script to simulate fast-forward and fast-rewind in Virtualdub. It uses the aforementioned key hold-down method but Autohotkey seems to be capable of sending keystrokes much faster than the physical keyboard; at least it does on my computer.


SingleInstance
#MaxThreadsPerHotkey 2
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.

vdubLeftDown:=false
vdubRightDown:=false
#IfWinActive, ahk_class VirtualDub

	;fast forward toggle
	e::
		global vdubLeftDown
		global vdubRightDown
		vdubLeftDown:=false
		vdubRightDown:=!vdubRightDown
		while vdubRightDown
		{
			if (WinActive("ahk_class VirtualDub"))
				send, {Right down}
			else
				break
			;Sleep, 50
		}
		send, {Right Up}
	return
	;fast backward toggle
	q::
		vdubRightDown:=false
		vdubLeftDown:=!vdubLeftDown
		while vdubLeftDown
		{
			If (WinActive("ahk_class VirtualDub"))
				send, {Left down}
			else
				break
			;Sleep, 50
		}
		send, {Left Up}
	return	
	w::
		vdubLeftDown:=false
		vdubRightDown:=false
	return
	
#IfWinActive

How to use

Shortcut Function
e Toggle fast-forward
q Toggle fast-rewind
w Stop fast-preview

The script will preview as fast as your computer allows. If you are in the happy situation where the preview is too fast, comment out the Sleep function and add an appropriate delay.

Leave a Comment

Your email address will not be published.