From 1d03eb78596db9db181b907d11c9d2ddd5606798 Mon Sep 17 00:00:00 2001 From: Sour Date: Mon, 23 Dec 2019 16:49:54 -0500 Subject: [PATCH] Debugger: Hex Editor - Give keyboard focus to the hex editor when form is opened --- GUI.NET/Debugger/Controls/ctrlHexViewer.cs | 5 +++++ GUI.NET/Debugger/frmMemoryViewer.cs | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/GUI.NET/Debugger/Controls/ctrlHexViewer.cs b/GUI.NET/Debugger/Controls/ctrlHexViewer.cs index 5114fb57..e03c7c39 100644 --- a/GUI.NET/Debugger/Controls/ctrlHexViewer.cs +++ b/GUI.NET/Debugger/Controls/ctrlHexViewer.cs @@ -68,6 +68,11 @@ namespace Mesen.GUI.Debugger.Controls mnuViewInMemoryType.InitShortcut(this, nameof(DebuggerShortcutsConfig.MemoryViewer_ViewInMemoryType)); } + public new void Focus() + { + this.ctrlHexBox.Focus(); + } + public byte[] GetData() { return this._byteProvider != null ? this._byteProvider.Bytes.ToArray() : new byte[0]; diff --git a/GUI.NET/Debugger/frmMemoryViewer.cs b/GUI.NET/Debugger/frmMemoryViewer.cs index b6c593c8..dfe06853 100644 --- a/GUI.NET/Debugger/frmMemoryViewer.cs +++ b/GUI.NET/Debugger/frmMemoryViewer.cs @@ -99,6 +99,12 @@ namespace Mesen.GUI.Debugger this.InitShortcuts(); } + protected override void OnShown(EventArgs e) + { + base.OnShown(e); + ctrlHexViewer.Focus(); + } + protected override void OnFormClosing(FormClosingEventArgs e) { base.OnFormClosing(e);