QuickGui block

skorpio

14-03-2009 04:27:59

Hello,

I'm working on a program that uses QuickGui. I started to use the text box
but whenever I click on it to get focus, my character moves there.
I would like to know how to prevent this, that is, Is there a callback that
tell you when you are mousing-over a QuickGUI element?

I was able to block this behavior for button by using the mouse_release event
So whenever, this is triggered then my character doesn't move.
I tried it with the key_up event but it doesn't work.

Any suggestions?

Thanks,

Skorpio

kungfoomasta

14-03-2009 08:57:49

The GUIManager's injection functions return bool, ie

bool injectMouseButtonDown(const MouseButtonID& button);

If "true" is returned, the event has was useful to QuickGUI. You should only forward input to your game if the GUI hasn't consumed it. Note that there are still some minor fixes I need to make, but generally, if the injectX function returns true, you shouldn't forward the input to your system.

skorpio

15-03-2009 00:54:47

Hello,

Thanks for the tip. I switched my code from Mouse Released to Mouse Pressed.
It works great!

FYI, the Mouse Released, return False when clicking on the text box.

Best Regards,

Skorpio

skorpio

30-03-2009 01:46:12

Hello,

I used the return value from the inject to see if the mouse was within
one of the QuickGUI controls. It works most of the time.

I noticed that if you double-click or click really fast on a button then
the injectMouseDown returns false. Any ideas?

Best Reagards,

Skorpio

kungfoomasta

30-03-2009 03:21:26

I've combed over the code again, and made some changes, hopefully I caught the problem. :)