aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.WinForms
diff options
context:
space:
mode:
Diffstat (limited to 'ShiftOS.WinForms')
-rw-r--r--ShiftOS.WinForms/Applications/MindBlow.cs8
1 files changed, 6 insertions, 2 deletions
diff --git a/ShiftOS.WinForms/Applications/MindBlow.cs b/ShiftOS.WinForms/Applications/MindBlow.cs
index 15361c2..4fcda03 100644
--- a/ShiftOS.WinForms/Applications/MindBlow.cs
+++ b/ShiftOS.WinForms/Applications/MindBlow.cs
@@ -22,6 +22,7 @@ namespace ShiftOS.WinForms.Applications
{
private TextBox box;
private KeysConverter kc;
+ public KeyPressEventHandler handler;
public TextBoxStream(TextBox mybox)
{
kc = new KeysConverter();
@@ -55,7 +56,7 @@ namespace ShiftOS.WinForms.Applications
{
object lck = new object();
int ptr = offset;
- KeyPressEventHandler handler = (o, a) =>
+ handler = (o, a) =>
{
lock (lck)
{
@@ -98,6 +99,7 @@ namespace ShiftOS.WinForms.Applications
private static string[] DefaultMem;
private BFInterpreter Interpreter;
private Thread InterpreterThread;
+ private TextBoxStream consolestr;
private void DoLayout()
{
memlist.Left = 0;
@@ -121,7 +123,8 @@ namespace ShiftOS.WinForms.Applications
for (ushort i = 0; i < 30000; i++)
DefaultMem[i] = "0";
memlist.Items.AddRange(DefaultMem);
- Interpreter = new BFInterpreter(new TextBoxStream(consoleout), this);
+ consolestr = new TextBoxStream(consoleout);
+ Interpreter = new BFInterpreter(consolestr, this);
}
public void IPtrMoved(int newval)
@@ -212,6 +215,7 @@ namespace ShiftOS.WinForms.Applications
InterpreterThread.Abort();
}
catch { }
+ consoleout.KeyPress -= consolestr.handler;
}
private void reset_Click(object sender, EventArgs e)