1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Add support for handling keyboard shortcuts.

This commit is contained in:
Bartosz Taudul
2018-12-22 17:36:20 +01:00
parent 4bb4a568ca
commit 2d143ce516
2 changed files with 18 additions and 1 deletions
+11 -1
View File
@@ -482,6 +482,17 @@ bool View::DrawImpl()
return !wasCancelled;
}
const auto& io = ImGui::GetIO();
assert( m_shortcut == ShortcutAction::None );
if( io.KeyCtrl )
{
if( ImGui::IsKeyPressed( 'F' ) )
{
m_shortcut = ShortcutAction::OpenFind;
}
}
if( !m_frames ) m_frames = m_worker.GetFramesBase();
const auto th = ImGui::GetTextLineHeight();
@@ -700,7 +711,6 @@ bool View::DrawImpl()
if( m_goToFrame ) DrawGoToFrame();
if( m_lockInfoWindow != InvalidId ) DrawLockInfoWindow();
const auto& io = ImGui::GetIO();
if( m_zoomAnim.active )
{
m_zoomAnim.progress += io.DeltaTime * m_zoomAnim.lenMod;