Page 1 of 1
Combining key input with gui buttons
Posted: Mon Feb 27, 2006 12:33 pm
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?
Posted: Mon Feb 27, 2006 2:55 pm
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