-------------------------------------------------------------------------------- -- Handler.......... : onKeyboardKeyDown -- Author........... : -- Description...... : -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- function FPVMain.onKeyboardKeyDown ( kKeyCode ) -------------------------------------------------------------------------------- -- Switch inputs handling on escape key -- if ( kKeyCode == input.kKeyEscape ) then this.enableInputsHandling ( not this.bHandleInputs ( ) ) end if ( this.bHandleInputs ( ) ) then local cam = application.getCurrentUserActiveCamera ( ) if ( kKeyCode == input.kKeySpace ) then object.sendEvent ( cam, "FPVCamera", "onJump" ) elseif ( kKeyCode == input.kKeyUp ) then object.sendEvent ( cam, "FPVCamera", "onGoForward", true ) elseif ( kKeyCode == input.kKeyDown ) then object.sendEvent ( cam, "FPVCamera", "onGoBackward", true ) elseif ( kKeyCode == input.kKeyRight ) then object.sendEvent ( cam, "FPVCamera", "onStrafeRight", true ) elseif ( kKeyCode == input.kKeyLeft ) then object.sendEvent ( cam, "FPVCamera", "onStrafeLeft", true ) end end -------------------------------------------------------------------------------- end --------------------------------------------------------------------------------