mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-12 21:10:42 +00:00
Make Ctrl-# shortcuts for EventBrowser bookmarks work anywhere
This commit is contained in:
@@ -1013,12 +1013,12 @@ namespace renderdocui.Windows
|
||||
return m_Bookmark.Contains(EID);
|
||||
}
|
||||
|
||||
private bool HasBookmark(int index)
|
||||
public bool HasBookmark(int index)
|
||||
{
|
||||
return index >= 0 && index < m_Bookmark.Count;
|
||||
}
|
||||
|
||||
private UInt32 GetBookmark(int index)
|
||||
public UInt32 GetBookmark(int index)
|
||||
{
|
||||
if (!HasBookmark(index))
|
||||
return 0;
|
||||
|
||||
@@ -1119,6 +1119,32 @@ namespace renderdocui.Windows
|
||||
return false;
|
||||
}
|
||||
|
||||
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
|
||||
{
|
||||
// bookmark keys are handled globally
|
||||
if ((keyData & Keys.Control) == Keys.Control)
|
||||
{
|
||||
Keys[] digits = { Keys.D1, Keys.D2, Keys.D3, Keys.D4, Keys.D5,
|
||||
Keys.D6, Keys.D7, Keys.D8, Keys.D9, Keys.D0 };
|
||||
|
||||
for (int i = 0; i < digits.Length; i++)
|
||||
{
|
||||
if ((keyData & digits[i]) == digits[i])
|
||||
{
|
||||
EventBrowser eb = m_Core.GetEventBrowser();
|
||||
|
||||
if (eb.Visible && eb.HasBookmark(i))
|
||||
{
|
||||
m_Core.SetEventID(null, m_Core.CurFrame, eb.GetBookmark(i));
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return base.ProcessCmdKey(ref msg, keyData);
|
||||
}
|
||||
|
||||
private void MainWindow_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
foreach (var live in m_LiveCaptures)
|
||||
|
||||
Reference in New Issue
Block a user