Jump to content

Prevent too fast clicks


Recommended Posts

  • Moderators

Hi all,

Can I just remind everyone that there is a Moderation Team on this forum who decide what is legal and what is not. So if you have any doubts just report the thread and move on - please do not get involved in pointless arguments between members. Although I feel I should point out that Werty is quite wrong in his assumption:

Quote

if the poor guy is trying to prevent his doubleclicking mouse from throwing 2 handgrenades instead of one, it hasnt got anything to do with game automation og botting.

That most certainly is game automation and/or "botting" - and so against the Forum rules.

But for what it is worth I have seen nothing so far in this thread which would warrant closing it.

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:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

@mikell I second that 1000 times.

[disclaimer] I do this kind of thing (repairing all kind of electronic boards) for a living.

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Link to comment
Share on other sites

4 hours ago, Werty said:

Arr come on, why dont you just say "GAME",

Because whether it is a GAME or not is irrelevant...

My point being that the OP asks for help with a script to fix his double clicking mouse.

The indefatigable @Nine delivers, as usual, a framework script, making use of direct OS calls, which appears to work in the general case.

However, the OP is clearly nonplussed by this, and says:

Quote

What is the advantage of doing this on a that low level within windows/driver environment? I am asking because this script seems to interfere with the mouse sensitivity. It remains normal on desktop, but is severly changed in full screen applications. The sensitivity drops massively then.

Could maybe a more basic approach also have the desired result, without doing anyting on the driver level and therefore without the resulting impact on mouse sensitivity? 

Thereby bringing up the revelation that this fix should work in full-screen applications for the first time.  As you may know, “full-screen applications” often access I/O hardware directly for reasons of both performance and so that the I/O devices are harder to manipulate for unintended purposes.

Such apps are not all the same in their access methods, even if you were to make it work in one, that’s not a guarantee it work in another.

Given this, if the OP were to continue requesting help, he would have to at a minimum specify the full-screen apps that are in question.

Yet instead of providing that, he bizarrely laments the “low level” of the fix, and actually asks for an approach even less likely to work.   

Edited by JockoDundee
Accidental post

Code hard, but don’t hard code...

Link to comment
Share on other sites

15 hours ago, JockoDundee said:

Because whether it is a GAME or not is irrelevant...

My point being that the OP asks for help with a script to fix his double clicking mouse.

The indefatigable @Nine delivers, as usual, a framework script, making use of direct OS calls, which appears to work in the general case.

However, the OP is clearly nonplussed by this, and says:

Thereby bringing up the revelation that this fix should work in full-screen applications for the first time.  As you may know, “full-screen applications” often access I/O hardware directly for reasons of both performance and so that the I/O devices are harder to manipulate for unintended purposes.Such apps are not all the same in thtinue requesting help, he would have to at a minimum specify th

eir access methods, even if you were to make it work in one, that’s not a guarantee it work in another.

Given this, if the OP were to con

e full-screen apps that are in question.

Yet instead of providing that, he bizarrely laments the “low level” of the fix, and actually asks for an approach even less likely to work.   

 

I know some people view certain forums as an extension of their living rooms. However what you are doing is plain trolling in my eyes. When the question is how to prevent too fast clicks, you suggest windows options, which does pretty much the exact opposite and you do it in an impolite manner with an image, for which on other media i would already block you without a single word directed at you. Then you continue to declare your opionion what a waste of time this is, which as a standalone statement is an opinion that is not constructive in any way either and makes me wonder what makes you believe that i am interested in that opinion. A suggestion for the future. If you want to say that something is more work than it is worth it, point out the problems and maybe you are being taken serious. After all the problem was considered grave enough by the poster to create a forum account, voice the question and look for solutions. You just ignore the request to stay on topic and keep on ranting. Don't you have anything better to do?

As I said, I am grateful for Nine's help, but two problems remains. The solution should work in an unobstrusive way for a user doing what average users do and that includes highlighting text, dragging files and folders and ofc also full screen apps. And as it seems, dragging/highlighting is still a problem with this solution, as is the mentioned impact on mouse sensitivity. So if that aproach is not working in the desired way due to limitations beyond my knowledge, then I have to try to find a different solution, prefarably simpler, or might have to live with the double click till i can order the new mouse and then I might even try to replace the switch in that razer piece of junk. After all it's a brand new mouse, sent as a replacement by razer and only in use for a couple month, before it started failing again. But obviously i wont try something like that, which i never tried before, while i still need the mouse and it still mostly works.

So, you can consider my rant as finished.

Back onto the topic, it seems more complicated than I suspected. I was thinking of a simple approach, but when researching i realized that it is not as simple as using hotkeyset, because even if i use _ispressed(1) and call for mouseup or down events, i can not prevent the mouse up event that I need to prevent in order to achieve my goal of being able to drag, hightlight and single/doubleclick without problems. Basically i was researching on how i could add a eg 30ms delay to all leftmousebutton up events and at the end of the given timespan, check if there has been another mouse down event in the meantime, which would invalidate the mouse up event, because it is was so fast that it is obviously caused by the faulty hardware.

So, i basically ran into a dead end on each approach i thought of. On _ispressed approach i can send mouse up and down, but can not prevent the faulty event. I was then thinking of circumventing the problem by assigning different keys to mouse up and mouse down in the mouse software in order to be able to use the hotkeyset command, but not a big surprise, the software does not allow for that. The only thing that seems like a possible option, is the MouseOnEvent UDF i found, however i am not entirely sure that this approach would work, nor if it is worth the time and effort to get it to work with my not even basic knowledge.

Can anyone say, if the MouseOnEvent UDF would allow me to do what I explained? Delay a mouse button up event for x ms, to check a timer before deciding to either send the leftmousebutton up event or to simply ignore and discard it. A check for the mouse down also needs to be applied logically, as also another mouse down is disruptive, but that wouldnt change the requirements I suppose. And I wonder, is that approach also "going deep" like Nine's solution, using hooks into the mouse driver or similar?

 

Link to comment
Share on other sites

MouseOnEvent UDF uses the same callback as I do.  Open the code and take a look.  The only difference is that the UDF has wrapped a lot of code for multiple purposes.  Don't see how it will help you better, but who knows.  You need to start coding and experiment by yourself now.

Link to comment
Share on other sites

12 minutes ago, Nine said:

MouseOnEvent UDF uses the same callback as I do.  Open the code and take a look.  The only difference is that the UDF has wrapped a lot of code for multiple purposes.  Don't see how it will help you better, but who knows.  You need to start coding and experiment by yourself now.

Ah, that's a pity because I want to avoid that approach for various reasons, mouse sensitivity being one. Unless anyone got a suggestion that does not interfere with the driver and resembles more of an approach, similar to how it would work on a keyboard and hotkeyset, I guess I will have to put up with it till june. Thanks for your time though!

Link to comment
Share on other sites

So,

14 hours ago, sunToxx said:

When the question is how to prevent too fast clicks, you suggest windows options, which does pretty much the exact opposite...

Yes, I did and yes it was. It was sloppy of me and I’m sorry.

Next you claim that

14 hours ago, sunToxx said:

...you continue to declare your opionion what a waste of time this is...

Well this is just plain false, as the record clearly shows. Of my 4 prior posts, only one could be considered as leveling such criticism. There was no continuing. Furthermore, it was not just a declaration but a response to the calculus that you provided yourself, namely:

Quote

Throw away a 100€ mouse cause of double clicks?

Then you say that I

14 hours ago, sunToxx said:

...ignore the request to stay on topic and keep on ranting.

This is also false, as the record shows.  My next post was indisputably on topic:

Quote

Which “full screen applications” are you speaking of?

This is the crux of my criticism, the late reveal of the requirement that the fix work with “full-screen apps” and the inability to rectify by identifying the apps in question, to this day.

Even after was explained to you of the difficulty in intercepting I/O events from “full screen apps”, due to the fact that they typically employ countermeasures to prevent such manipulation.

Comically, then you want to move to a “macro” level, even higher than what @Nine had written.  If anything, Nine would have go down to the BIOS level or even bare-metal programming to get the jump on the “full screen apps”

Finally, back to the alternatives that you formerly eschewed, which now beckon strongly.

1) Fix your existing mouse.  

You said:

On 4/16/2021 at 8:36 AM, sunToxx said:

I also have more mice like that. Almost all my mice died due to double clicking.

If this is the case then fixing should be made easier because you have a couple to practice on and salvage parts from.  You also have the encouragement of @jchd, who “does this for...a living”.  Also, you could likely swap the switches between L and R on just one mouse.

2) Buy a new mouse.

You said,

Quote

The only other viable option for this type of mouse (15+ button mouse) is corsair, but they are sold out till at least june in my place.

In that case, (assuming “your place” is Germany), you’ll be happy to know that there may be several viable mice available as early this Friday, including this model from Amazon.

EF776ED6-43EA-43F8-B247-D9D2536D0D95.thumb.jpeg.3fdd50c47880cc1538974e6548357018.jpeg

Edited by JockoDundee

Code hard, but don’t hard code...

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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