diff --git a/CHANGELOG.md b/CHANGELOG.md index c3e8003..5d5d671 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ * (Add) Tooltip for next and previous layer buttons with associated shortcut (#61) * (Fix) LGS: Some plugins and slicers use XY resolution information, while others are swapped, a auto swap will be performed when required (#59) +* (Fix) Global hotkeys prevent user from typing that key on controls (#62) ## 16/09/2020 - v0.8.2.2 diff --git a/UVtools.GUI/FrmMain.cs b/UVtools.GUI/FrmMain.cs index 0678bbe..41a0200 100644 --- a/UVtools.GUI/FrmMain.cs +++ b/UVtools.GUI/FrmMain.cs @@ -334,9 +334,9 @@ namespace UVtools.GUI { return; } - if (e.KeyChar == 's') { + if (!CanGlobalHotKey) return; ShowLayer(false); e.Handled = true; return; @@ -344,6 +344,7 @@ namespace UVtools.GUI if (e.KeyChar == 'w') { + if (!CanGlobalHotKey) return; ShowLayer(true); e.Handled = true; return; @@ -362,6 +363,7 @@ namespace UVtools.GUI if (e.KeyCode == Keys.Home) { + if (!CanGlobalHotKey) return; btnFirstLayer.PerformClick(); e.Handled = true; return; @@ -371,6 +373,7 @@ namespace UVtools.GUI if (e.KeyCode == Keys.End) { + if (!CanGlobalHotKey) return; btnLastLayer.PerformClick(); e.Handled = true; return; @@ -4303,6 +4306,15 @@ namespace UVtools.GUI return true; } - + public bool CanGlobalHotKey + => !(ActiveControl is TextBox + || ActiveControl is ComboBox + || ActiveControl is NumericUpDown + || ActiveControl is RichTextBox + || ActiveControl is ListView + || ActiveControl is ObjectListView + || ActiveControl is FastObjectListView); + + } }