asusralis
Topic Author
Posts: 97
Joined: 30 Jul 2018, 05:03

How to stop button mid press?

17 Nov 2020, 20:16

I have a group of buttons in a canvas that can be panned. If a button is being pressed and the mouse moves, I want the button to lose focus and not be pressed on mouse up. I can't seem to find a way to just stop a button from being pressed.
 
User avatar
sfernandez
Site Admin
Posts: 1975
Joined: 22 Dec 2011, 19:20

Re: How to stop button mid press?

17 Nov 2020, 22:07

If you want to drag the panel then you need to capture the mouse (so you still receive move events when mouse is outside the canvas), and if you do so then the Button will automatically be released and click aborted.

Have you tried that?
 
asusralis
Topic Author
Posts: 97
Joined: 30 Jul 2018, 05:03

Re: How to stop button mid press?

19 Nov 2020, 18:43

Ah, I was trying to use CaptureMouse() but it didn't seem to work, so I have been using my own flag for when the mouse is panning. I will try to use it again.

Who is online

Users browsing this forum: cancred and 6 guests