Jump to content

Recommended Posts

Posted (edited)

Sup?

My mouse is screwy and sometimes when I click once it will send the action 4 times more than what its supposed to. The solution is buy a new mouse. I'm cheap and like to fix my problems with code. If only everything in life could be solved with a script. So, How can I prevent multiple mouse clicks from being sent simultaneously? I have no use for double clicking and I find it to be a nuisance therefore I would like to block the functionality altogether to where it is no longer possible. I understand that this would have to implement some kind of hooking mechanism and that is where I'm lost. If you guies/girls could help me out I would greatly appreciate it.

Anonymous

Edited by Decipher
  Reveal hidden contents

 

Posted (edited)

Here we go

Function

  • Blocks the Double-Click
  • If Double-Click is detected while Control is pressed the block is cancelled
-Try double-clicking the Titlebar of any window to see if it maximizes or not ;)

#include <WinAPI.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>

HotKeySet("{ESC}", "Terminate")
OnAutoItExitRegister("Cleanup")

Global $hModule = _WinAPI_GetModuleHandle(0)

Global $hMouseProc = DllCallbackRegister("LowLevelMouseProc", "long", "int;wparam;lparam")
Global $pMouseProc = DllCallbackGetPtr($hMouseProc)
Global $hMouseHook = _WinAPI_SetWindowsHookEx($WH_MOUSE_LL, $pMouseProc, $hModule)

Global $iCheck = $WM_LBUTTONDOWN

While 1
Sleep(10)
WEnd

; http://msdn.microsoft.com/en-us/library/ms644986(v=vs.85).aspx
Func LowLevelMouseProc($nCode, $wParam, $lParam)

Static $iTimer = -1 ;Make the Var Static

If $nCode >= 0 And ($wParam = $iCheck) Then
$aRet = DllCall("user32.dll", "uint", "GetDoubleClickTime")
$aRet = $aRet[0]

;Double Click and Control not pressed - Block it
If TimerDiff($iTimer) <= $aRet And _IsPressed("11") = 0 Then Return 1

$iTimer = TimerInit()
EndIf

Return _WinAPI_CallNextHookEx($hMouseHook, $nCode, $wParam, $lParam)

EndFunc ;==>LowLevelMouseProc

Func Cleanup()
_WinAPI_UnhookWindowsHookEx($hMouseHook)
DllCallbackFree($hMouseProc)
EndFunc ;==>Cleanup

Func Terminate()
Exit
EndFunc ;==>Terminate

Regards :)

Edited by PhoenixXL

My code:

  Reveal hidden contents
PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Posted

Nevertheless, buy a new mouse!

2$ isn't too expensive.

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted

U.S Government ?

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted

Mr. President?

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted

  Quote

If I need to highlight something I have to hold down the ctrl button. I doubt it but is there a way to remedy the mouse button not being able to be held down?

*Edit - when I scroll its laggy and the computer's motherboard beeps with error.

You can check the _IsPressed function and change the CTRL button to any other. I don't get what the problem is with the Scroll Bar part

My code:

  Reveal hidden contents
PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Posted

Decipher,

why did you remove your OP?

The time you've already spent on this subject is worth more than 2$ for a new mouse!

Is a defect mouse the real problem?

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted

What was the original question? As I only have the title to go by, I presume the user is looking at WM_LBUTTONDBLCLK, though the title is more descriptive than the actual body of text.

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted

The original question was:

  Quote

Sup?

My mouse is screwy and sometimes when I click once it will send the action 4 times more than what its supposed to. The solution is buy a new mouse. I'm cheap and like to fix my problems with code. If only everything in life could be solved with a script. So, How can I prevent multiple mouse clicks from being sent simultaneously? I have no use for double clicking and I find it to be a nuisance therefore I would like to block the functionality altogether to where it is no longer possible. I understand that this would have to implement some kind of hooking mechanism and that is where I'm lost. If you guies/girls could help me out I would greatly appreciate it.

Anonymous

Found in Google cache.

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted

Google caches pretty quick these days. Thanks water. I think your suggestion is the most appropriate.

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted

guinness,

I heard that users can relocate their signature items to their profile page and link to that listing instead. Just a suggestion of course.

On Topic:

I don't think a new wireless mouse can be bought for $2. I don't care. I wanted a solution and I got one. It dosen't amaze me that a lot of users on these forums have thousands of posts... AutoIt ForumsAutoIt v3General Help and Support <--You are here

Thanks for the help everyone, well really just PhoenixXL but I understand you tried...I think :)

Anonymous

  Reveal hidden contents

 

Posted (edited)

This user sent me a PM a week ago stating they read the first line of my signature, got bored and moved on. They then continued to state I should do something about it and "move my links elsewhere." That's tne reason for their off-topic comment towards me.

What people don't realise is the profile isn't viewable to non-members.

Edited by guinness

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted

Who said you have to be amazed by the fact "that a lot of users on these forums have thousands of posts"?

My UDFs and Tutorials:

  Reveal hidden contents

 

  • Moderators
Posted

Decipher,

You have a PM incoming - please read it and respond. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...