DirectGUI: Having buttons respond on mouse down

Is there a means of having buttons – preferably just certain buttons, but a project-wide change might be worth considering – issue their “command” function on mouse down rather than, as seems to be the current behaviour, on mouse up?

To explain, I have a few GUI buttons used as part of my gameplay that I’ve found that I sometimes want to click on quickly, then move rapidly to a point in the game-world. Unfortunately and frustratingly, this sometimes leads to the button not taking the click, presumably as a result of the mouse-up event taking place after I’ve moved back into the game-world.

Now, it may be that I’d be better off changing the way that my UI works – perhaps having a double-click summon the present buttons and automatically pause the game to reduce the desire to move quickly – but I’d like to explore the mouse-down method first, if feasible.

You can use bind() to attach an event to B1PRESS to have a function triggered when the mouse is clicked down, rather than the usual down-and-up.


Fair enough, and thank you. :slight_smile: