Combining key input with gui buttons

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
Kazuya
Posts: 3
Joined: Wed Feb 15, 2006 12:20 pm

Combining key input with gui buttons

Post by Kazuya »

I am making a game that only requires keyboard input to play but I want to control the starting menus(options/ new game etc.) with a mouse. can Event.GUIEvent.EventType be used at the same time as Event.keyInput.key?? If it's possibile how do I go about it?
jrm
Posts: 111
Joined: Tue Dec 13, 2005 8:57 pm

Post by jrm »

Just add them into the same OnEvent function.

Code: Select all

    if (event.KeyInput.Key == irr::KEY_ESCAPE && event.KeyInput.PressedDown==true)
    {
        device->closeDevice();
    }
   if (event.EventType == irr::EET_MOUSE_INPUT_EVENT &&
		event.MouseInput.Event == EMIE_RMOUSE_LEFT_UP )
	{
		//do something..
	}
JRM
Post Reply