Page 1 of 1

[V2 B] Lost mouse events

Posted: 22 Oct 2021, 02:13
by arcticir
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
}

Re: [V2 B] Lost mouse events

Posted: 22 Oct 2021, 03:52
by lexikos
Register for WM_LBUTTONDBLCLICK as well.
:roll:

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

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

Posted: 22 Oct 2021, 04:07
by kczx3
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
}

Re: [V2 B] Lost mouse events

Posted: 22 Oct 2021, 04:43
by arcticir
Thanks, I can't believe I overlooked the double click. :oops: