I'm trying to vary the speed of the FPS-Camera.
With Arrow keys only the speed should be 0.1.
And if additionally the shift key is pressed, the speed should be 1.
Therefore I reused and modified the code of the example 09.Meshviewer.
I added the following event handler:
Code: Select all
/*
Handle key-down events
*/
bool OnKeyDown(irr::EKEY_CODE keyCode)
{
// Don't handle keys if we have a modal dialog open as it would lead
// to unexpected application behavior for the user.
if ( hasModalDialog() )
return false;
if ((keyCode == irr::KEY_RSHIFT) && (keyCode == irr::KEY_UP))
{
MovingSpeed = 1;
}
}
What am I doing wrong?
Greetings
Markus