@@ -1630,15 +1630,9 @@ void VR::on_pre_imgui_frame() {
16301630 }
16311631}
16321632
1633- void VR::on_frame () {
1633+ void VR::handle_keybinds () {
16341634 ZoneScopedN (__FUNCTION__);
16351635
1636- m_cvar_manager->on_frame ();
1637-
1638- if (!get_runtime ()->ready ()) {
1639- return ;
1640- }
1641-
16421636 if (m_keybind_recenter->is_key_down_once ()) {
16431637 recenter_view ();
16441638 }
@@ -1663,6 +1657,21 @@ void VR::on_frame() {
16631657 m_2d_screen_mode->toggle ();
16641658 }
16651659
1660+ if (m_keybind_disable_vr->is_key_down_once ()) {
1661+ m_disable_vr = !m_disable_vr; // definitely should not be persistent
1662+ }
1663+ }
1664+
1665+ void VR::on_frame () {
1666+ ZoneScopedN (__FUNCTION__);
1667+
1668+ m_cvar_manager->on_frame ();
1669+ handle_keybinds ();
1670+
1671+ if (!get_runtime ()->ready ()) {
1672+ return ;
1673+ }
1674+
16661675 const auto now = std::chrono::steady_clock::now ();
16671676 const auto is_allowed_draw_window = now - m_last_xinput_update < std::chrono::seconds (2 );
16681677
@@ -2236,8 +2245,9 @@ void VR::on_draw_sidebar_entry(std::string_view name) {
22362245 }
22372246
22382247 ImGui::SetNextItemOpen (true , ImGuiCond_::ImGuiCond_Once);
2239- if (ImGui::TreeNode (" Overlay Keys" )) {
2248+ if (ImGui::TreeNode (" Overlay/Runtime Keys" )) {
22402249 m_keybind_toggle_2d_screen->draw (" Toggle 2D Screen Mode Key" );
2250+ m_keybind_disable_vr->draw (" Disable VR Key" );
22412251
22422252 ImGui::TreePop ();
22432253 }
@@ -2277,6 +2287,7 @@ void VR::on_draw_sidebar_entry(std::string_view name) {
22772287 ImGui::Checkbox (" Disable View Matrix Override" , &m_disable_view_matrix_override);
22782288 ImGui::Checkbox (" Disable Backbuffer Size Override" , &m_disable_backbuffer_size_override);
22792289 ImGui::Checkbox (" Disable VR Overlay" , &m_disable_overlay);
2290+ ImGui::Checkbox (" Disable VR Entirely" , &m_disable_vr);
22802291 ImGui::Checkbox (" Stereo Emulation Mode" , &m_stereo_emulation_mode);
22812292 ImGui::Checkbox (" Wait for Present" , &m_wait_for_present);
22822293 ImGui::Checkbox (" Controllers allowed" , &m_controllers_allowed);
0 commit comments