Page 1 of 1

mouseEntered/Exited

Posted: Fri Feb 11, 2005 19:04
by paulr1984
I have a FrameWindow in my ogre application and I want to detect when the mouse enters/exits the FrameWindow. I tried mouseEntered/Exited but cannot detect when the mouse enters/exits the framewindow. Is it suupposed to do that? Or does it only detect when the mouse enters/leaves the entire ogre application?

I need this because I have to know if the user is clicking on the gui or on the 3d landscape. If its clicking on the gui, I should not move the camera. But if its clicking on the landscape, then I should move the camera towards that point.

Basically, the application I'm making is like your normal rpg. When the player is clicking on the inventory gui, you don't move the player's character towards that point.

Take it easy on me. I'm quite new to cegui. Thanks!

Re: mouseEntered/Exited

Posted: Fri Feb 11, 2005 23:03
by pjcast
I subscribe the event CEGUI::Window::EventMouseEnters for my buttons, and it calls my callback when the event happens, and I'm sure the Exits would also work.

Re: mouseEntered/Exited

Posted: Sat Feb 12, 2005 09:46
by CrazyEddie
I can also say that I have previously tested these events and there should be no problems.

Perhaps there is something else preventing things from working correctly?

Re: mouseEntered/Exited

Posted: Sat Feb 12, 2005 11:10
by NSXEagle
My problem was quite the same: When the user doesn't click on a GUI element, then do 3D picking (and select an object if there's one), otherwise do no picking.

Here is my approach:
I subscribed a mouseButtonUp (mouseClicked should do it, too) event for the root window of the GUI. When the user clicks and doesn't hit a GUI element, the hits the root window, so 3D picking is executed. If he clicks on a GUI element, he doesn't click on the root window, so nothing happens.

Hope I could help you.