Work on shortcuts - thx OmrSi :)

This commit is contained in:
niksedk 2021-07-25 17:25:31 +02:00
parent f37477ac4a
commit d10545e58e

View File

@ -14895,7 +14895,9 @@ namespace Nikse.SubtitleEdit.Forms
// do not check for shortcuts if text is being entered and a textbox is focused
var textBoxTypes = new List<string> { "AdvancedTextBox", "SimpleTextBox", "SETextBox", "TextBox", "RichTextBox" };
if (textBoxTypes.Contains(typeName) && !Configuration.Settings.General.AllowLetterShortcutsInTextBox)
if (textBoxTypes.Contains(typeName) &&
((e.KeyCode >= Keys.A && e.KeyCode <= Keys.Z) || (e.KeyCode >= Keys.OemSemicolon && e.KeyCode <= Keys.OemBackslash) || e.KeyCode >= Keys.NumPad0 && e.KeyCode <= Keys.NumPad9 || e.KeyValue >= 48 && e.KeyValue <= 57) &&
!Configuration.Settings.General.AllowLetterShortcutsInTextBox)
{
return;
}