public KeystrokeMessage(Control control, MouseEventArgs e, KeystrokeMotion motion) { this.control = control; this.e = e; this.motion = motion; }
public void Process(Instruction instruction, KeystrokeMotion motion) { Trace.WriteLineIf(classTraceSwitch.TraceInfo, "Process: " + motion.ToString() + " " + instruction.Symbol.Name + " " + instruction.ToString(), classTraceSwitch.DisplayName); switch (mode) { case EngineMode.Run: switch (motion) { case KeystrokeMotion.Down: switch ((SymbolConstants)instruction.Symbol.Id) { case SymbolConstants.SYMBOL_BST: program.GotoRelative(-1); display.Mode = DisplayMode.Instruction; program.PreviewInstruction(); break; case SymbolConstants.SYMBOL_R_S: case SymbolConstants.SYMBOL_SST: // The display mode will be reset by EnableOpenOrSave after // execution of the next instruction (i.e., when the key goes // up). display.Mode = DisplayMode.Instruction; program.PreviewInstruction(); break; default: ExecuteSequence(instruction); break; } ; break; case KeystrokeMotion.Up: switch ((SymbolConstants)instruction.Symbol.Id) { case SymbolConstants.SYMBOL_BST: case SymbolConstants.SYMBOL_R_S: case SymbolConstants.SYMBOL_SST: ExecuteSequence(instruction); break; default: break; } break; } break; case EngineMode.WriteProgram: switch (motion) { case KeystrokeMotion.Down: switch ((SymbolConstants)instruction.Symbol.Id) { case SymbolConstants.SYMBOL_BST: program.GotoRelative(-1); break; case SymbolConstants.SYMBOL_CL_PRGM: program.Clear(); break; case SymbolConstants.SYMBOL_DEL: program.Delete(); break; case SymbolConstants.SYMBOL_GTO_PERIOD: Execute(instruction); break; case SymbolConstants.SYMBOL_SST: program.GotoRelative(+1); break; default: program.Insert(instruction); break; } break; case KeystrokeMotion.Up: break; } break; } }