From 56d17fe1f23284e90d19d3992ab24d437a4cccb4 Mon Sep 17 00:00:00 2001 From: Jaex Date: Wed, 29 Jun 2022 02:02:26 +0300 Subject: [PATCH] Restrict zoom keybinds to image editor --- .../Forms/RegionCaptureForm.cs | 41 +++++++++++-------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/ShareX.ScreenCaptureLib/Forms/RegionCaptureForm.cs b/ShareX.ScreenCaptureLib/Forms/RegionCaptureForm.cs index f15619dc5..3232e7072 100644 --- a/ShareX.ScreenCaptureLib/Forms/RegionCaptureForm.cs +++ b/ShareX.ScreenCaptureLib/Forms/RegionCaptureForm.cs @@ -657,25 +657,34 @@ internal void RegionCaptureForm_KeyDown(object sender, KeyEventArgs e) case Keys.Control | Keys.C: CopyAreaInfo(); break; - case Keys.Control | Keys.Alt | Keys.D0: - ZoomToFit(); - break; - case Keys.Control | Keys.D0: - ZoomFactor = 1; - CenterCanvas(); - break; - case Keys.Control | Keys.Oemplus: - Zoom(true, false); - break; - case Keys.Control | Keys.OemMinus: - Zoom(false, false); - break; } - if (!IsEditorMode && e.KeyData >= Keys.D0 && e.KeyData <= Keys.D9) + if (IsEditorMode) { - MonitorKey(e.KeyData - Keys.D0); - return; + switch (e.KeyData) + { + case Keys.Control | Keys.Alt | Keys.D0: + ZoomToFit(); + break; + case Keys.Control | Keys.D0: + ZoomFactor = 1; + CenterCanvas(); + break; + case Keys.Control | Keys.Oemplus: + Zoom(true, false); + break; + case Keys.Control | Keys.OemMinus: + Zoom(false, false); + break; + } + } + else + { + if (e.KeyData >= Keys.D0 && e.KeyData <= Keys.D9) + { + MonitorKey(e.KeyData - Keys.D0); + return; + } } }