Which comes first? EET_GUI_EVENT or EET_MOUSE_INPUT_EVENT

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
shurijo
Posts: 148
Joined: Sat Feb 21, 2004 3:04 am

Which comes first? EET_GUI_EVENT or EET_MOUSE_INPUT_EVENT

Post by shurijo »

I ran into the situation where my EET_MOUSE_INPUT_EVENTs take precedence over my EET_GUI_EVENTs. :(

For example, when I click on a button, the event is sent as a MOUSE_INPUT_EVENT rather than a GUI_EVENT.

Is it possible for me to have both? :) I'm trying to use GUI elements as my HUD items and I can't get the GUI events to fire, because its seen as a Mouse event.

Code: Select all

if (event.EventType == irr::EET_KEY_INPUT_EVENT && !event.KeyInput.PressedDown)
{
     switch (event.KeyInput.Key )
     { ... }
}
else if (event.EventType == irr::EET_GUI_EVENT)		
{			
     switch(event.GUIEvent.EventType)
     { ... }
}
else if (event.EventType == irr::EET_MOUSE_INPUT_EVENT )
{
     switch(event.MouseInput.Event)
    {...}
}
thanks,

Shur
shurijo
Posts: 148
Joined: Sat Feb 21, 2004 3:04 am

Post by shurijo »

Lots of views, but no responses. I guess this can't be done. I'll wait a few days and post in the Advanced Help. :o
Guest

Post by Guest »

i haven't tried anything like this myself, but as i understand it with gui's first a MOUSE_INPUT_EVENT is generated, the engine then checks if this event occured on a gui intem and then generates the GUI_EVENT. I think what is happening is that this first event is picked up by your code, and as you are handling it manually the event is removed before it checks if the click was on a GUI item. Off the top of my head the only solution i can think of is to replicate the gui handling code from the engine in your own for EET_MOUSE_INPUT_EVENT. This isn't really a very good or elegant solution however so maybe someone else has an idea
Post Reply