diff --git a/Source/Core/Windows/ScriptFindReplaceForm.Designer.cs b/Source/Core/Windows/ScriptFindReplaceForm.Designer.cs index 697e36e3..e6a9cc51 100755 --- a/Source/Core/Windows/ScriptFindReplaceForm.Designer.cs +++ b/Source/Core/Windows/ScriptFindReplaceForm.Designer.cs @@ -210,6 +210,7 @@ namespace CodeImp.DoomBuilder.Windows this.findbox.Name = "findbox"; this.findbox.Size = new System.Drawing.Size(276, 21); this.findbox.TabIndex = 0; + this.findbox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.findbox_KeyDown); // // tabreplace // @@ -244,6 +245,7 @@ namespace CodeImp.DoomBuilder.Windows this.replacebox.Name = "replacebox"; this.replacebox.Size = new System.Drawing.Size(276, 21); this.replacebox.TabIndex = 1; + this.replacebox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.replacebox_KeyDown); // // label5 // @@ -288,6 +290,7 @@ namespace CodeImp.DoomBuilder.Windows this.replacefindbox.Name = "replacefindbox"; this.replacefindbox.Size = new System.Drawing.Size(276, 21); this.replacefindbox.TabIndex = 0; + this.replacefindbox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.replacefindbox_KeyDown); // // label4 // diff --git a/Source/Core/Windows/ScriptFindReplaceForm.cs b/Source/Core/Windows/ScriptFindReplaceForm.cs index b3e569ad..e0fdc85b 100755 --- a/Source/Core/Windows/ScriptFindReplaceForm.cs +++ b/Source/Core/Windows/ScriptFindReplaceForm.cs @@ -228,6 +228,17 @@ namespace CodeImp.DoomBuilder.Windows } } + // The form doesn't have a regular "close" button, so we have to intercept the Esc key + protected override bool ProcessDialogKey(Keys keyData) + { + if (ModifierKeys == Keys.None && keyData == Keys.Escape) + { + this.Hide(); + return true; + } + return base.ProcessDialogKey(keyData); + } + #endregion #region ================== Events @@ -387,6 +398,24 @@ namespace CodeImp.DoomBuilder.Windows else throw new NotImplementedException("Unsupported tab type"); } + private void findbox_KeyDown(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.Enter) + findnextbutton_Click(sender, EventArgs.Empty); + } + + private void replacefindbox_KeyDown(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.Enter) + findnextbutton_Click(sender, EventArgs.Empty); + } + + private void replacebox_KeyDown(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.Enter) + replacebutton_Click(sender, EventArgs.Empty); + } + #endregion } } \ No newline at end of file diff --git a/Source/Core/Windows/ScriptFindReplaceForm.resx b/Source/Core/Windows/ScriptFindReplaceForm.resx index 75f8c555..1cf88662 100755 --- a/Source/Core/Windows/ScriptFindReplaceForm.resx +++ b/Source/Core/Windows/ScriptFindReplaceForm.resx @@ -125,7 +125,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAc - CQAAAk1TRnQBSQFMAgEBAgEAASABAAEgAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + CQAAAk1TRnQBSQFMAgEBAgEAAVABAAFQAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA