Merge pull request #748 from benvanik/benvanik-reconnect-hotkey

Adding ctrl-r as a hotkey for reconnecting from the main profiler view.
This commit is contained in:
Bartosz Taudul 2024-03-12 21:52:40 +01:00 committed by GitHub
commit f39a2fd3ee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 0 deletions

View File

@ -2391,6 +2391,8 @@ The \emph{discovered clients} list is only displayed if clients are broadcasting
Both connecting to a client and opening a saved trace will present you with the main profiler view, which you can use to analyze the data (see section~\ref{analyzingdata}). Both connecting to a client and opening a saved trace will present you with the main profiler view, which you can use to analyze the data (see section~\ref{analyzingdata}).
Once connected to a client \keys{\ctrl + \shift + \Alt + R} can be used to quickly discard any captured data and reconnect to a client at the same address.
\subsubsection{Connection information pop-up} \subsubsection{Connection information pop-up}
\label{connectionpopup} \label{connectionpopup}

View File

@ -648,6 +648,16 @@ bool View::Draw()
ImGui::EndPopup(); ImGui::EndPopup();
} }
if( !m_staticView &&
( ImGui::IsModKey( ImGuiKey_LeftCtrl ) || ImGui::IsModKey( ImGuiKey_RightCtrl ) ) &&
( ImGui::IsModKey( ImGuiKey_LeftShift ) || ImGui::IsModKey( ImGuiKey_RightShift ) ) &&
( ImGui::IsModKey( ImGuiKey_LeftAlt ) || ImGui::IsModKey( ImGuiKey_RightAlt ) ) &&
ImGui::IsKeyPressed( ImGuiKey_R ) )
{
m_reconnectRequested = true;
return false;
}
s_time += ImGui::GetIO().DeltaTime; s_time += ImGui::GetIO().DeltaTime;
return DrawImpl(); return DrawImpl();
} }