/// <summary> /// 当状态变成Escape的时候触发 /// </summary> /// <param name="ch"></param> private void EventEscape(byte ch) { if (ASCIIChars.IsC0Code(ch)) { this.ActionExecute(ch); } else if (ASCIIChars.IsDelete(ch)) { this.ActionIgnore(ch); } else if (ASCIIChars.IsIntermediate(ch)) { this.ActionCollect(ch); this.EnterEscapeIntermediate(); } else if (this.isAnsiMode) { if (ASCIIChars.IsCSIIndicator(ch)) { // 0x5B,进入到了csi entry状态 this.EnterCSIEntry(); } else if (ASCIIChars.IsOSCIndicator(ch)) { // 0x5D,进入到了osc状态 this.EnterOSCParam(); } else if (ASCIIChars.IsDCSIndicator(ch)) { // 0x50,进入到了dcs状态 this.EnterDCSEntry(); } else { this.ActionEscDispatch(ch); this.EnterGround(); } } else if (ASCIIChars.IsVt52CursorAddress(ch)) { // 判断是否是VT52模式下的移动光标指令, 当进入了VT52模式下才会触发 // 在VT52模式下只有移动光标的指令有参数,所以这里把移动光标的指令单独做处理 this.EnterVt52Param(); } else { // 这里是其他的不带参数的VT52控制字符 this.ActionVt52EscDispatch(ch); this.EnterGround(); } }