[V2 B] Lost mouse events Topic is solved

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
arcticir
Posts: 694
Joined: 17 Nov 2013, 11:32

[V2 B] Lost mouse events

Post by arcticir » 22 Oct 2021, 02:13

In this example, if I click on the window 8 times quickly, the WM_LBUTTONDOWN function will only trigger 4 times or less.
If I click the window slowly 8 times, WM_LBUTTONDOWN will trigger correctly 8 times.
I tried using other methods, such as OnEvent("Click", ) , but that didn't work either.
The only way I have found to safely receive all mouse events is to register the left button as a hotkey.

Code: Select all

t:=gui()
t.show("w200 h200")
OnMessage(0x0201, WM_LBUTTONDOWN)



WM_LBUTTONDOWN(*){
static id:=0
id++
ToolTip id
}

lexikos
Posts: 9583
Joined: 30 Sep 2013, 04:07
Contact:

Re: [V2 B] Lost mouse events

Post by lexikos » 22 Oct 2021, 03:52

Register for WM_LBUTTONDBLCLICK as well.
:roll:

Topic moved (from Bug Reports to Ask for Help v2).

User avatar
kczx3
Posts: 1640
Joined: 06 Oct 2015, 21:39

Re: [V2 B] Lost mouse events  Topic is solved

Post by kczx3 » 22 Oct 2021, 04:07

https://forum.powerbasic.com/forum/user-to-user-discussions/powerbasic-for-windows/54664-detecting-rapid-mouse-presses

Code: Select all

t:=gui()
t.show("w200 h200")
OnMessage(0x0201, WM_LBUTTONDOWN) ; Left single
OnMessage(0x0203, WM_LBUTTONDOWN) ; left double
OnMessage(0x0204, WM_RBUTTONDOWN) ; right single

id := 0

WM_LBUTTONDOWN(*){
    global id
    id++
    ToolTip id
}

WM_RBUTTONDOWN(*) {
    global id
    id := 0
    tooltip id
}

arcticir
Posts: 694
Joined: 17 Nov 2013, 11:32

Re: [V2 B] Lost mouse events

Post by arcticir » 22 Oct 2021, 04:43

Thanks, I can't believe I overlooked the double click. :oops:

Post Reply

Return to “Ask for Help (v2)”