TAStudio - hook up Ctrl+Mousewheel to frame advance and rewind events. TODO: Figure out how to (also) add right-click + mousewheel

This commit is contained in:
adelikat 2012-08-17 01:01:46 +00:00
parent 99f073266d
commit 932303df68
2 changed files with 21 additions and 4 deletions

View File

@ -460,9 +460,9 @@
//
// TASView
//
this.TASView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.TASView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.TASView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.Frame,
this.Log});
@ -479,7 +479,7 @@
this.TASView.UseCompatibleStateImageBehavior = false;
this.TASView.View = System.Windows.Forms.View.Details;
this.TASView.SelectedIndexChanged += new System.EventHandler(this.TASView_SelectedIndexChanged);
this.TASView.DoubleClick += new System.EventHandler(this.TASView_DoubleClick);
this.TASView.MouseWheel += new System.Windows.Forms.MouseEventHandler(this.TASView_MouseWheel);
//
// Frame
//

View File

@ -542,5 +542,22 @@ namespace BizHawk.MultiClient
}
return "";
}
private void TASView_MouseWheel(object sender, MouseEventArgs e)
{
//if ((Control.MouseButtons & MouseButtons.Middle) > 0) //adelikat: TODO: right-click + mouse wheel won't work because in this dialog, right-click freezes emulation in the main window. Why? Hex Editor doesn't do this for instance
if ((Control.ModifierKeys & Keys.Control) > 0)
{
if (e.Delta > 0) //Scroll up
{
Global.MovieSession.Movie.RewindToFrame(Global.Emulator.Frame - 1);
}
else if (e.Delta < 0) //Scroll down
{
Global.MainForm.PressFrameAdvance = true;
}
}
}
}
}