Mouse and GUI events don't play nicely with each other

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
KG
Posts: 35
Joined: Wed Jun 07, 2006 12:00 am

Mouse and GUI events don't play nicely with each other

Post by KG »

Code: Select all

	if (event.EventType == EET_MOUSE_INPUT_EVENT)
	{
		switch (event.MouseInput.Event) 
		{
			case EMIE_LMOUSE_PRESSED_DOWN:
			{
				printf("%i, %i\n", event.MouseInput.X, event.MouseInput.Y);
				return true;
			}
		}

	}
I wrote the above code to test out mouse events, and it works great. It prints out the co-ordinates of wherever you click in the console. However, it seems to stop GUI events from working. Clicks on GUI objects like buttons and menus do not register! How can I get these two event types to work together?

My GUI events worked perfectly before I added this code to my event receiver, so I think this part is the problem.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

return false which keeps the event from traversing through the event receiver hierarchy.
KG
Posts: 35
Joined: Wed Jun 07, 2006 12:00 am

Post by KG »

Thanks so much, that seems to have fixed it!
esaptonor
Posts: 145
Joined: Sat May 06, 2006 11:59 pm

Post by esaptonor »

I am positive i have the same problem, none of the gui elements do anything, the tabs dont change, the buttons dont click, etc
But i am returning false, and the problem bit of code is a addInOutFader() from the gui environment. When i run that, the rest of the gui doesn't work.
This is with irrlicht 1.0, but i would like to know if this is a bug, or how i can fix it so that i can still have a fader.
thanks,
esaptonor
Post Reply