Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Disabling double click when it happens too fast

I have an issue where my mouse sometimes double clicks instead of single clicks.
I want to disable this double click. Again, this happens very fast so it is easily distinguishable from a normal double click.

Can anyone help me with this macro, as I'm not sure how to start.
I found a similar issue online, but the script is for AHK.

This is the AHK script:
Select All      Help
If (A_TimeSincePriorHotkey < 100) ;hyperclick
sendinput {LButton down}
KeyWait, LButton
sendinput {LButton up}

Also please don't suggest that I get my mouse replaced. It's a pretty expensive mouse, warranty is gone and I am not willing to invest that much money when the mouse works almost perfectly.

Thanks for the help!

Function disable_too_fast_double_click
Select All      Help
;Run this function.
;Run again if want to end it.
;Edit the 100 if need. Don't need more editing.

if getopt(nthreads)>1
,EndThread "disable_too_fast_double_click"

int hh=SetWindowsHookEx(WH_MOUSE_LL &sub.Hook_WH_MOUSE_LL _hinst 0)
opt waitmsg 1
wait -1
UnhookWindowsHookEx hh

#sub Hook_WH_MOUSE_LL
function# nCode message MSLLHOOKSTRUCT&m
if(nCode<0) goto gNext

;if(message!=WM_MOUSEMOVE) OutWinMsg message 0 0 _s; out "%s at %i %i" _s

int-- prevTime disableNextUp
sel message
,if(timeGetTime-prevTime < 100) disableNextUp=1; ret 1
,if(disableNextUp) disableNextUp=0; ret 1

ret CallNextHookEx(0 nCode message &m)

Forum Jump:

Users browsing this thread: 1 Guest(s)