Hex Editor - arrow & tab keys navigate the memory viewer

This commit is contained in:
andres.delikat 2011-03-10 19:25:01 +00:00
parent 0360a52e6e
commit f33837bf5d
2 changed files with 44 additions and 8 deletions

View File

@ -48,13 +48,13 @@
this.settingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.restoreWindowSizeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.autoloadToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveWindowsSettingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.AddressBox = new System.Windows.Forms.TextBox();
this.ViewerContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
this.pokeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.freezeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.addToRamWatchToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.MemoryViewer = new BizHawk.MultiClient.MemoryViewer();
this.saveWindowsSettingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuStrip1.SuspendLayout();
this.ViewerContextMenuStrip.SuspendLayout();
this.SuspendLayout();
@ -203,8 +203,16 @@
this.autoloadToolStripMenuItem.Text = "Auto-load";
this.autoloadToolStripMenuItem.Click += new System.EventHandler(this.autoloadToolStripMenuItem_Click);
//
// saveWindowsSettingsToolStripMenuItem
//
this.saveWindowsSettingsToolStripMenuItem.Name = "saveWindowsSettingsToolStripMenuItem";
this.saveWindowsSettingsToolStripMenuItem.Size = new System.Drawing.Size(194, 22);
this.saveWindowsSettingsToolStripMenuItem.Text = "Save windows settings";
this.saveWindowsSettingsToolStripMenuItem.Click += new System.EventHandler(this.saveWindowsSettingsToolStripMenuItem_Click);
//
// AddressBox
//
this.AddressBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.AddressBox.Location = new System.Drawing.Point(487, 37);
this.AddressBox.Name = "AddressBox";
this.AddressBox.ReadOnly = true;
@ -256,13 +264,6 @@
this.MemoryViewer.Paint += new System.Windows.Forms.PaintEventHandler(this.MemoryViewer_Paint);
this.MemoryViewer.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.MemoryViewer_MouseDoubleClick);
//
// saveWindowsSettingsToolStripMenuItem
//
this.saveWindowsSettingsToolStripMenuItem.Name = "saveWindowsSettingsToolStripMenuItem";
this.saveWindowsSettingsToolStripMenuItem.Size = new System.Drawing.Size(194, 22);
this.saveWindowsSettingsToolStripMenuItem.Text = "Save windows settings";
this.saveWindowsSettingsToolStripMenuItem.Click += new System.EventHandler(this.saveWindowsSettingsToolStripMenuItem_Click);
//
// HexEditor
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);

View File

@ -66,6 +66,41 @@ namespace BizHawk.MultiClient
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.MemoryViewer_KeyDown);
}
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if (keyData == Keys.Up)
{
addressHighlighted -= 16;
this.Refresh();
}
else if (keyData == Keys.Down)
{
addressHighlighted += 16;
this.Refresh();
}
else if (keyData == Keys.Left)
{
addressHighlighted -= 1;
this.Refresh();
}
else if (keyData == Keys.Right)
{
addressHighlighted += 1;
this.Refresh();
}
else if (keyData == Keys.Tab)
{
addressHighlighted += 8;
this.Refresh();
}
return true;
}
private void ClearNibbles()
{
for (int x = 0; x < 4; x++)