MCPcopy Create free account
hub / github.com/NVIDIA-RTX/RTXPT / KeyboardUpdate

Method KeyboardUpdate

Rtxpt/Sample.cpp:675–707  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

673}
674
675bool Sample::KeyboardUpdate(int key, int scancode, int action, int mods)
676{
677 if (m_zoomTool && m_zoomTool->KeyboardUpdate(key, scancode, action, mods))
678 return true;
679
680 if (!(m_sampleGame && m_sampleGame->CameraActive()))
681 m_camera.KeyboardUpdate(key, scancode, action, mods);
682
683 if (m_sampleGame && m_sampleGame->KeyboardUpdate(key, scancode, action, mods))
684 return true;
685
686
687 if (key == GLFW_KEY_SPACE && action == GLFW_PRESS && mods != GLFW_MOD_CONTROL && mods != GLFW_MOD_ALT)
688 {
689 m_ui.EnableAnimations = !m_ui.EnableAnimations;
690 return true;
691 }
692 if( key == GLFW_KEY_F2 && action == GLFW_PRESS )
693 m_ui.ShowUI = !m_ui.ShowUI;
694 if( key == GLFW_KEY_R && action == GLFW_PRESS && mods == GLFW_MOD_CONTROL )
695 m_ui.ShaderReloadRequested = true;
696
697#if DONUT_WITH_STREAMLINE
698 if (key == GLFW_KEY_F13 && action == GLFW_PRESS)
699 {
700 // As GLFW abstracts away from Windows messages
701 // We instead set the F13 as the PC_Ping key in the constants and compare against that.
702 GetDeviceManager()->GetStreamline().ReflexTriggerPcPing(GetFrameIndex());
703 }
704#endif
705
706 return true;
707}
708
709bool Sample::MousePosUpdate(double xpos, double ypos)
710{

Callers

nothing calls this directly

Calls 1

CameraActiveMethod · 0.80

Tested by

no test coverage detected