From 50a02d713d6a54d8ffd7397c2ffcb4f80746a762 Mon Sep 17 00:00:00 2001 From: baldurk Date: Wed, 10 May 2017 10:49:04 +0100 Subject: [PATCH] Only apply ctrl-left/right shortcut when it doesn't conflict. Refs #542 * We only apply it for non-textbox controls since there ctrl-left and ctrl-right move through words. * Also only apply it while a capture is open. --- renderdocui/Windows/MainWindow.cs | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/renderdocui/Windows/MainWindow.cs b/renderdocui/Windows/MainWindow.cs index 16cc7628d..b130d3d0e 100644 --- a/renderdocui/Windows/MainWindow.cs +++ b/renderdocui/Windows/MainWindow.cs @@ -1717,24 +1717,29 @@ namespace renderdocui.Windows } } - if (keyData == (Keys.Control | Keys.Left)) + Control sender = Control.FromHandle(msg.HWnd); + + if (m_Core.LogLoaded && !(sender is TextBox) && !(sender is ScintillaNET.Scintilla)) { - FetchDrawcall draw = m_Core.CurDrawcall; + if (keyData == (Keys.Control | Keys.Left)) + { + FetchDrawcall draw = m_Core.CurDrawcall; - if (draw != null && draw.previous != null) - m_Core.SetEventID(null, draw.previous.eventID); + if (draw != null && draw.previous != null) + m_Core.SetEventID(null, draw.previous.eventID); - return true; - } + return true; + } - if (keyData == (Keys.Control | Keys.Right)) - { - FetchDrawcall draw = m_Core.CurDrawcall; + if (keyData == (Keys.Control | Keys.Right)) + { + FetchDrawcall draw = m_Core.CurDrawcall; - if (draw != null && draw.next != null) - m_Core.SetEventID(null, draw.next.eventID); + if (draw != null && draw.next != null) + m_Core.SetEventID(null, draw.next.eventID); - return true; + return true; + } } } return base.ProcessCmdKey(ref msg, keyData);