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

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:
Code:
Copy      Help
LButton::
If (A_TimeSincePriorHotkey < 100) ;hyperclick
Return
sendinput {LButton down}
KeyWait, LButton
sendinput {LButton up}
Return

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!

Antoine
#2
Function disable_too_fast_double_click
Code:
Copy      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"
,ret

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 m.pt.x m.pt.y

int-- prevTime disableNextUp
sel message
,case [WM_LBUTTONDOWN,WM_RBUTTONDOWN,WM_MBUTTONDOWN]
,if(timeGetTime-prevTime < 100) disableNextUp=1; ret 1
,disableNextUp=0
,
,case [WM_LBUTTONUP,WM_RBUTTONUP,WM_MBUTTONUP]
,prevTime=timeGetTime
,if(disableNextUp) disableNextUp=0; ret 1

;gNext
ret CallNextHookEx(0 nCode message &m)


Forum Jump:


Users browsing this thread: 1 Guest(s)