Skip to content

Instantly share code, notes, and snippets.

@dakshin-k
Created May 27, 2020 09:52
Show Gist options
  • Save dakshin-k/b081d0844137f63a2f1a03335ba19051 to your computer and use it in GitHub Desktop.
Save dakshin-k/b081d0844137f63a2f1a03335ba19051 to your computer and use it in GitHub Desktop.
AutoHotKey Script for Three finger Click and Drag gesture on Windows
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#SingleInstance force
drag_enabled := 0
+^#F22::
if(drag_enabled)
{
Click up
drag_enabled := 0
}
else
{
drag_enabled := 1
Click down
}
return
LButton::
if(drag_enabled)
{
Click up
drag_enabled := 0
}
else
click
return
@DeadFishC
Copy link

DeadFishC commented May 19, 2021

For mouse dragging to work LButton should be written like this:

LButton::
	if(drag_enabled)
	{
		Click up
		drag_enabled := 0
	}
	else
	{
		Click down
		KeyWait, LButton
		Click up
	}
	return

@felipealvesgnu
Copy link

@dakshin-k 🥇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment