Open ldemailly opened 2 years ago
But this changed break other mouse event, and can't listening MouseDown before drag too.
Sorry I am not following, what does break? (can you give an example)
You can click mouse, and the mouse down and up is not right.
which os? for me it works with the PR changes on Windows 11
Mac os. And the PR should be tested before merge.
Well I just tested on Max OS and same, it only works the way I need for my patch
Try:
https://github.com/ldemailly/gohook_sample/blob/main/mouseIssue.go
note that the issue is the missing mouse Up, if you click and hold; the end (release) should be MouseUp and with your original code it's MouseDown
This being said with my patch it's both
with your original code: click and hold, then release:
16:25:04 I mouseIssue.go:20> Mouse Button 1 down (hold)
16:25:05 I mouseIssue.go:27> Mouse Button 1 down event
(ie my issue #32)
with your original code: quick tap/click: (without holding/dragging):
16:26:20 I mouseIssue.go:20> Mouse Button 1 down (hold)
16:26:20 I mouseIssue.go:27> Mouse Button 1 down event
16:26:20 I mouseIssue.go:25> Mouse Button 1 released
with my change: (with the replace in go.mod)
click and hold; then release:
16:28:11 I mouseIssue.go:20> Mouse Button 1 down (hold)
16:28:13 I mouseIssue.go:25> Mouse Button 1 released
which is what I need/expect
but yes quick tap:
16:28:53 I mouseIssue.go:20> Mouse Button 1 down (hold)
16:28:53 I mouseIssue.go:25> Mouse Button 1 released
16:28:53 I mouseIssue.go:27> Mouse Button 1 down event
the down event is unreliable as it's missing anyway when holding
but release should be
If you have a better fix for #32 that sounds great and close this one
Fixes #32 (verified on Windows 11)