From 4b021113fb385b901ce8be372f5884f6395f8f91 Mon Sep 17 00:00:00 2001 From: "andres.delikat" Date: Thu, 18 Aug 2011 01:50:17 +0000 Subject: [PATCH] Hex Editor - Fix so Ctrl+G hotkey works --- BizHawk.MultiClient/tools/HexEditor.cs | 13 +------------ BizHawk.MultiClient/tools/MemoryViewer.cs | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/BizHawk.MultiClient/tools/HexEditor.cs b/BizHawk.MultiClient/tools/HexEditor.cs index 1f210b60cd..9ce0448be9 100644 --- a/BizHawk.MultiClient/tools/HexEditor.cs +++ b/BizHawk.MultiClient/tools/HexEditor.cs @@ -173,18 +173,7 @@ namespace BizHawk.MultiClient private void goToAddressToolStripMenuItem_Click(object sender, EventArgs e) { - InputPrompt i = new InputPrompt(); - i.Text = "Go to Address"; - i.SetMessage("Enter a hexadecimal value"); - i.ShowDialog(); - - if (i.UserOK) - { - if (InputValidate.IsValidHexNumber(i.UserText)) - { - GoToAddress(int.Parse(i.UserText, NumberStyles.HexNumber)); - } - } + MemoryViewer.GoToSpecifiedAddress(); } public void GoToAddress(int address) diff --git a/BizHawk.MultiClient/tools/MemoryViewer.cs b/BizHawk.MultiClient/tools/MemoryViewer.cs index c228d45c3c..9b27554780 100644 --- a/BizHawk.MultiClient/tools/MemoryViewer.cs +++ b/BizHawk.MultiClient/tools/MemoryViewer.cs @@ -128,6 +128,8 @@ namespace BizHawk.MultiClient { if (!InputValidate.IsValidHexNumber(((char)e.KeyCode).ToString())) { + if (e.Control && e.KeyCode == Keys.G) + GoToSpecifiedAddress(); e.Handled = true; return; } @@ -497,5 +499,23 @@ namespace BizHawk.MultiClient ClearNibbles(); Refresh(); } + + public void GoToSpecifiedAddress() + { + InputPrompt i = new InputPrompt(); + i.Text = "Go to Address"; + i.SetMessage("Enter a hexadecimal value"); + Global.Sound.StopSound(); + i.ShowDialog(); + Global.Sound.StartSound(); + + if (i.UserOK) + { + if (InputValidate.IsValidHexNumber(i.UserText)) + { + GoToAddress(int.Parse(i.UserText, NumberStyles.HexNumber)); + } + } + } } }