Prevent accidental clicks while typing

Get help with using AutoHotkey and its commands and hotkeys
vsub
Posts: 180
Joined: 29 Sep 2015, 03:39

Prevent accidental clicks while typing

19 Aug 2019, 13:56

You all touchpad users know the annoying situation of accidentally touching the touchpad while typing and making a mess if you don't look at the screen often
This prevent clicking if the mouse cursor is in IBeam mode(typing)

Any ideas how I can improve it?

Code: Select all

#If (A_Cursor = "IBeam")
$LButton::
; Prevent LButton because while typing,double clicking is almost impossible,there will always be some other key pressed
If (A_PriorKey = "LButton") 
{
Send,{LButton Down}
Keywait,LButton
Send,{LButton Up}
Return
}
; Send LButton if I did not type anything in the last 1.5 seconds
If ((A_TimeSincePriorHotkey > 1500) & (A_PriorKey != "LButton")) 
{
Send,{LButton Down}
Keywait,LButton
Send,{LButton Up}
Return
}     
Return


#If

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], DuyMinh, momomo, pneumatic and 238 guests