my code is very simple (here are some parts of it)
Code: Select all
void CMyCamera::Move()
{
f32 speed = 1.5f;
if(_receiver.IsKeyDown(irr::KEY_RSHIFT))
{
speed = 10.0f;
}
//....not needed parts of code
}
and the some receiver methods
Code: Select all
bool CMyEventReceiver::OnEvent(const SEvent& event)
{
if (event.EventType == irr::EET_KEY_INPUT_EVENT) KeyIsDown[event.KeyInput.Key] = event.KeyInput.PressedDown;
if (event.EventType == irr::EET_MOUSE_INPUT_EVENT)
{
switch(event.MouseInput.Event)
{
case EMIE_LMOUSE_PRESSED_DOWN:
m_.left = 1;
break;
case EMIE_LMOUSE_LEFT_UP:
m_.left = 0;
break;
case EMIE_RMOUSE_PRESSED_DOWN:
m_.right = 1;
break;
case EMIE_RMOUSE_LEFT_UP:
m_.right = 0;
break;
case EMIE_MOUSE_MOVED:
m_.X = event.MouseInput.X;
m_.Y = event.MouseInput.Y;
m_.move = true;
break;
default:
m_.W = event.MouseInput.Wheel;
m_.move = false;
break;
}
}
return false;
}