diff options
| author | RogueAI42 <[email protected]> | 2017-06-19 17:30:55 +1000 |
|---|---|---|
| committer | RogueAI42 <[email protected]> | 2017-06-19 17:30:55 +1000 |
| commit | 40b4c29b969f97004ec51c3c22b4b8263fadbef4 (patch) | |
| tree | 47004bfe852f64fdffac626c673ab60b79679f35 /ShiftOS.WinForms/Applications | |
| parent | b453978afc994eec4cd328f7b9348a1e263e097f (diff) | |
| download | shiftos_thereturn-40b4c29b969f97004ec51c3c22b4b8263fadbef4.tar.gz shiftos_thereturn-40b4c29b969f97004ec51c3c22b4b8263fadbef4.tar.bz2 shiftos_thereturn-40b4c29b969f97004ec51c3c22b4b8263fadbef4.zip | |
Fixed keyboard input & instruction pointer display
Diffstat (limited to 'ShiftOS.WinForms/Applications')
| -rw-r--r-- | ShiftOS.WinForms/Applications/MindBlow.cs | 8 |
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) |
