mirror of
https://github.com/ShareX/ShareX.git
synced 2024-06-28 11:10:23 +12:00
Merge pull request #6530 from ShareX/ocr-form-esc
fixed #6494: Allow closing OCR form with Esc key
This commit is contained in:
commit
a57c03af9e
2
ShareX/Tools/OCR/OCRForm.Designer.cs
generated
2
ShareX/Tools/OCR/OCRForm.Designer.cs
generated
|
@ -164,9 +164,11 @@ private void InitializeComponent()
|
|||
this.Controls.Add(this.lblResult);
|
||||
this.Controls.Add(this.cbLanguages);
|
||||
this.Controls.Add(this.lblLanguage);
|
||||
this.KeyPreview = true;
|
||||
this.Name = "OCRForm";
|
||||
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
|
||||
this.Shown += new System.EventHandler(this.OCRForm_Shown);
|
||||
this.KeyUp += new System.Windows.Forms.KeyEventHandler(this.OCRForm_KeyUp);
|
||||
((System.ComponentModel.ISupportInitialize)(this.nudScaleFactor)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
|
|
@ -171,6 +171,14 @@ private async void OCRForm_Shown(object sender, EventArgs e)
|
|||
await OCR(bmpSource);
|
||||
}
|
||||
|
||||
private void OCRForm_KeyUp(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.KeyCode == Keys.Escape)
|
||||
{
|
||||
Close();
|
||||
}
|
||||
}
|
||||
|
||||
private async void btnSelectRegion_Click(object sender, EventArgs e)
|
||||
{
|
||||
FormWindowState previousState = WindowState;
|
||||
|
|
Loading…
Reference in a new issue