From 5596533459c854d41a3dc295587027c8efcd8b4e Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 16 Sep 2014 19:30:10 +0100 Subject: [PATCH] Add handler for escape/enter shortcut keys in the dialog --- renderdocui/Windows/Dialogs/TextureSaveDialog.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/renderdocui/Windows/Dialogs/TextureSaveDialog.cs b/renderdocui/Windows/Dialogs/TextureSaveDialog.cs index 7bb8fdcd0..ad38737b4 100644 --- a/renderdocui/Windows/Dialogs/TextureSaveDialog.cs +++ b/renderdocui/Windows/Dialogs/TextureSaveDialog.cs @@ -45,6 +45,22 @@ namespace renderdocui.Windows.Dialogs } } + protected override bool ProcessCmdKey(ref Message msg, Keys keyData) + { + if (keyData == Keys.Escape) + { + DialogResult = DialogResult.Cancel; + this.Close(); + return true; + } + if (keyData == Keys.Enter) + { + ok_Click(this, null); + return true; + } + return base.ProcessCmdKey(ref msg, keyData); + } + public FetchTexture tex = new FetchTexture(); public TextureSave saveData = new TextureSave();