Add injection hotkeys to main window

no save file required
This commit is contained in:
Kurt
2020-04-08 08:59:04 -07:00
parent a4ba8259a9
commit 0d979a8b7b
2 changed files with 33 additions and 0 deletions

View File

@@ -49,6 +49,7 @@ private void InitializeComponent()
this.Controls.Add(this.B_Open);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = global::NHSE.WinForms.Properties.Resources.icon;
this.KeyPreview = true;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "Main";
@@ -56,6 +57,7 @@ private void InitializeComponent()
this.Text = "NHSE";
this.DragDrop += new System.Windows.Forms.DragEventHandler(this.Main_DragDrop);
this.DragEnter += new System.Windows.Forms.DragEventHandler(this.Main_DragEnter);
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Main_KeyDown);
this.ResumeLayout(false);
}

View File

@@ -2,6 +2,7 @@
using System.IO;
using System.Windows.Forms;
using NHSE.Core;
using NHSE.Injection;
using NHSE.WinForms.Properties;
namespace NHSE.WinForms
@@ -117,5 +118,35 @@ private static void OpenSaveFile(string path)
settings.LastFilePath = path;
settings.Save();
}
private void Main_KeyDown(object sender, KeyEventArgs e)
{
if (ModifierKeys != Keys.Control)
return;
switch (e.KeyCode)
{
case Keys.O:
{
Menu_Open(sender, e);
break;
}
case Keys.I:
{
var items = new Item[40];
for (int i = 0; i < items.Length; i++)
items[i] = new Item(Item.NONE);
using var editor = new PlayerItemEditor<Item>(items, 10, 4, true);
editor.ShowDialog();
break;
}
case Keys.H:
{
using var editor = new SysBotRAMEdit(InjectionType.Generic);
editor.ShowDialog();
break;
}
}
}
}
}