Trace Logger - Ctrl+C on the instruction list now works

This commit is contained in:
adelikat 2012-09-30 15:33:54 +00:00
parent ec7522c11a
commit 960d6771c8
2 changed files with 26 additions and 0 deletions

View File

@ -87,6 +87,7 @@
this.TraceView.TabIndex = 4;
this.TraceView.UseCompatibleStateImageBehavior = false;
this.TraceView.View = System.Windows.Forms.View.Details;
this.TraceView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TraceView_KeyDown);
//
// Script
//

View File

@ -12,6 +12,11 @@ namespace BizHawk.MultiClient
{
public partial class TraceLogger : Form
{
//Log files as a path config option
//Save to file - saves what's on screen to disk (defaults to the current log file)
//Show file that is being logged to
//Browse button to set file
List<string> Instructions = new List<string>();
FileInfo LogFile;
@ -252,5 +257,25 @@ namespace BizHawk.MultiClient
private void CloseFile()
{
}
private void TraceView_KeyDown(object sender, KeyEventArgs e)
{
if (e.Control && e.KeyCode == Keys.C)
{
ListView.SelectedIndexCollection indexes = TraceView.SelectedIndices;
if (indexes.Count > 0)
{
StringBuilder blob = new StringBuilder();
foreach (int x in indexes)
{
blob.Append(Instructions[x]);
blob.Append('\n');
}
blob.Remove(blob.Length - 1, 1); //Lazy way to not have a line break at the end
Clipboard.SetDataObject(blob.ToString());
}
}
}
}
}