Page 1 of 1

How to stop button mid press?

Posted: 17 Nov 2020, 20:16
by asusralis
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.

Re: How to stop button mid press?

Posted: 17 Nov 2020, 22:07
by sfernandez
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?

Re: How to stop button mid press?

Posted: 19 Nov 2020, 18:43
by asusralis
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.