MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / onKeyEvent

Method onKeyEvent

Source/Falcor/Scene/Scene.cpp:3951–3988  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3949 }
3950
3951 bool Scene::onKeyEvent(const KeyboardEvent& keyEvent)
3952 {
3953 if (keyEvent.type == KeyboardEvent::Type::KeyPressed)
3954 {
3955 if (keyEvent.mods == Input::ModifierFlags::None)
3956 {
3957 if (keyEvent.key == Input::Key::F3)
3958 {
3959 addViewpoint();
3960 return true;
3961 }
3962 }
3963 // DEMO21, but I think it makes sense, to have these controls
3964 else if (keyEvent.key == Input::Key::C || keyEvent.key == Input::Key::F7)
3965 {
3966 // Force camera animation on.
3967 auto camera = mCameras[mSelectedCamera];
3968 camera->setIsAnimated(true);
3969 return true;
3970 }
3971 else if (keyEvent.key == Input::Key::F8)
3972 {
3973 auto camera = mCameras[mSelectedCamera];
3974 }
3975 }
3976 if (mCameraControlsEnabled)
3977 {
3978 // DEMO21, but I think it makes sense, if the camera did anything, stop the animation for it.
3979 if (mpCamCtrl->onKeyEvent(keyEvent))
3980 {
3981 auto& camera = mCameras[mSelectedCamera];
3982 camera->setIsAnimated(false);
3983 return true;
3984 }
3985 }
3986
3987 return false;
3988 }
3989
3990 bool Scene::onGamepadEvent(const GamepadEvent& gamepadEvent)
3991 {

Callers 2

handleKeyboardEventMethod · 0.45
handleKeyboardEventMethod · 0.45

Calls

no outgoing calls

Tested by 1

handleKeyboardEventMethod · 0.36