I'm trying to program a small Level-Editor for a game, and I'm stuck right now with a small problem.
I've implimented an "own" camera ("Own" because it's pretty much the Maya-Cam from Irrlicht)
The important section for me is the following:
Code: Select all
bool CameraEditorSceneNode::OnEvent(SEvent event)
{
if (event.EventType = irr::EET_MOUSE_INPUT_EVENT)
{
switch(event.MouseInput.Event)
{
case EMIE_LMOUSE_PRESSED_DOWN:
MouseKeys[0] = true;
break;
case EMIE_LMOUSE_LEFT_UP:
MouseKeys[0] = false;
break;
}
return false;
}
}
Code: Select all
bool IrrlichtManager::OnEvent(irr::SEvent event)
{
if (event.EventType = irr::EET_MOUSE_INPUT_EVENT)
{
switch(event.MouseInput.Event)
{
case(irr::EMIE_LMOUSE_PRESSED_DOWN):
this->selected = true;
break;
case(irr::EMIE_LMOUSE_LEFT_UP):
this->selected = false;
break;
}
}
return false;
};
The whole thing works fine in the Camera-Scenenode (else the camera wouldn't work at all ^^), but when it comes to my EventReceiver, something strange happens: When I press the Mouse-button, the varible is set to true, but when I release it, nothing happens! I controlled it in Debug-Mode, the programm never ever reachtes the second Case-Statement, and i just can't see any reason why! Is the "Left-Up" - Event somehow swallowed by the camera's OnEvent?
TiA
Lo_Ord