Fixed F10 key focusing the menu on key release

This commit is contained in:
ZZYZX 2019-12-31 15:32:57 +02:00
parent c00e2a8074
commit 7b5506363e
3 changed files with 12 additions and 0 deletions

View file

@ -89,6 +89,7 @@ namespace CodeImp.DoomBuilder.Controls
tabs.ImageList = scripticons; //mxd
PreviewKeyDown += new PreviewKeyDownEventHandler(ScriptEditorPanel_PreviewKeyDown);
KeyDown += new KeyEventHandler(ScriptEditorPanel_KeyDown);
KeyUp += new KeyEventHandler(ScriptEditorPanel_KeyDown);
}
// This initializes the control

View file

@ -1472,6 +1472,16 @@ namespace CodeImp.DoomBuilder.Windows
if(e.Handled)
e.SuppressKeyPress = true;
}
if (e.KeyCode == Keys.F10)
{
Actions.Action[] f10actions = General.Actions.GetActionsByKey((int)e.KeyData);
if (f10actions.Length > 0)
{
e.SuppressKeyPress = true;
e.Handled = true;
}
}
}
//mxd. Sometimes it's handeled by RenderTargetControl, not by MainForm leading to keys being "stuck"

View file

@ -49,6 +49,7 @@ namespace CodeImp.DoomBuilder.Windows
KeyPreview = true;
PreviewKeyDown += new PreviewKeyDownEventHandler(ScriptEditorForm_PreviewKeyDown);
KeyDown += new KeyEventHandler(ScriptEditorForm_KeyDown);
KeyUp += new KeyEventHandler(ScriptEditorForm_KeyDown);
}
#endregion