test mouse button maintained pressed

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
raananb
Super wx Problem Solver
Super wx Problem Solver
Posts: 385
Joined: Fri Oct 27, 2006 4:35 pm
Location: Paris, France
Contact:

test mouse button maintained pressed

Post by raananb » Sat Sep 07, 2019 2:35 pm

The only way I found to detect that a mouse button is maintained in Down position is to set a variable to true and launch a timer. The variable is set to false when the button is released, and this is caught bu the timer.

Is there a simpler way to detect if mouse button is maintained in down position?

User avatar
doublemax
Moderator
Moderator
Posts: 13989
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: test mouse button maintained pressed

Post by doublemax » Sat Sep 07, 2019 3:41 pm

I'm not sure if this is what you're looking for:
https://docs.wxwidgets.org/trunk/group_ ... 2b9dadaa25

This is less reliable than your version, because even this indicates that a mouse button is down, there could theoretically be a fast up-down sequence that happened in between the polling interval.
Use the source, Luke!

Post Reply