[Ttssh2-commit] [5629] Application Escape の改良テスト用。

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2014年 7月 3日 (木) 22:29:31 JST


Revision: 5629
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/5629
Author:   doda
Date:     2014-07-03 22:29:28 +0900 (Thu, 03 Jul 2014)
Log Message:
-----------
Application Escape の改良テスト用。
試験的機能のためマニュアル記述無し。

Modified Paths:
--------------
    trunk/teraterm/teraterm/keyboard.c
    trunk/teraterm/teraterm/vtterm.c

-------------- next part --------------
Modified: trunk/teraterm/teraterm/keyboard.c
===================================================================
--- trunk/teraterm/teraterm/keyboard.c	2014-07-01 03:19:07 UTC (rev 5628)
+++ trunk/teraterm/teraterm/keyboard.c	2014-07-03 13:29:28 UTC (rev 5629)
@@ -19,7 +19,8 @@
 #include "keyboard.h"
 
 BOOL AutoRepeatMode;
-BOOL AppliKeyMode, AppliCursorMode, AppliEscapeMode;
+BOOL AppliKeyMode, AppliCursorMode;
+int AppliEscapeMode;
 BOOL Send8BitMode;
 BYTE DebugFlag = DEBUG_FLAG_NONE;
 
@@ -142,11 +143,34 @@
       break;
     case VK_ESCAPE: // Escape Key
       if (Single) {
-	if (AppliEscapeMode) {
+	switch (AppliEscapeMode) {
+	case 1:
 	  CodeLength = 3;
 	  Code[0] = 0x1B;
 	  Code[1] = 'O';
 	  Code[2] = '[';
+	  break;
+	case 2:
+	  CodeLength = 2;
+	  Code[0] = 0x1B;
+	  Code[1] = 0x1B;
+	  break;
+	case 3:
+	  CodeLength = 2;
+	  Code[0] = 0x1B;
+	  Code[1] = 0x00;
+	  break;
+	case 4:
+	  CodeLength = 8;
+	  Code[0] = 0x1B;
+	  Code[1] = 0x1B;
+	  Code[2] = '[';
+	  Code[3] = '=';
+	  Code[4] = '2';
+	  Code[5] = '7';
+	  Code[6] = '%';
+	  Code[7] = '~';
+	  break;
 	}
       }
       break;
@@ -478,15 +502,38 @@
     case '3':
       if (Control && !ts.StrictKeyMapping) {
 	// Ctrl-3 -> ESC
-	if (AppliEscapeMode) {
+	switch (AppliEscapeMode) {
+	case 1:
 	  CodeLength = 3;
 	  Code[0] = 0x1B;
 	  Code[1] = 'O';
 	  Code[2] = '[';
-	}
-	else {
+	  break;
+	case 2:
+	  CodeLength = 2;
+	  Code[0] = 0x1B;
+	  Code[1] = 0x1B;
+	  break;
+	case 3:
+	  CodeLength = 2;
+	  Code[0] = 0x1B;
+	  Code[1] = 0x00;
+	  break;
+	case 4:
+	  CodeLength = 8;
+	  Code[0] = 0x1B;
+	  Code[1] = 0x1B;
+	  Code[2] = '[';
+	  Code[3] = '=';
+	  Code[4] = '2';
+	  Code[5] = '7';
+	  Code[6] = '%';
+	  Code[7] = '~';
+	  break;
+	default:
 	  CodeLength = 1;
 	  Code[0] = 0x1b;
+	  break;
 	}
       }
       break;

Modified: trunk/teraterm/teraterm/vtterm.c
===================================================================
--- trunk/teraterm/teraterm/vtterm.c	2014-07-01 03:19:07 UTC (rev 5628)
+++ trunk/teraterm/teraterm/vtterm.c	2014-07-03 13:29:28 UTC (rev 5629)
@@ -2726,7 +2726,7 @@
 	    BracketedPaste = TRUE;
 	    break;
 	  case 7727: // mintty Application Escape Mode
-	    AppliEscapeMode = TRUE;
+	    AppliEscapeMode = 1;
 	    break;
 	  case 7786: // Wheel to Cursor translation
 	    if (ts.TranslateWheelToCursor) {
@@ -2740,6 +2740,11 @@
 	    if (ts.MouseEventTracking)
 	      MouseReportMode = IdMouseTrackNetTerm;
 	    break;
+	  case 14002: // test Application Escape Mode 2
+	  case 14003: // test Application Escape Mode 3
+	  case 14004: // test Application Escape Mode 4
+	    AppliEscapeMode = Param[i] - 14000;
+	    break;
 	}
     }
 
@@ -2872,7 +2877,7 @@
 	    BracketedPaste = FALSE;
 	    break;
 	  case 7727: // mintty Application Escape Mode
-	    AppliEscapeMode = FALSE;
+	    AppliEscapeMode = 0;
 	    break;
 	  case 7786: // Wheel to Cursor translation
 	    AcceptWheelToCursor = FALSE;
@@ -2883,6 +2888,11 @@
 	  case 14001: // NetTerm mouse mode
 	    MouseReportMode = IdMouseTrackNone;
 	    break;
+	  case 14002: // test Application Escape Mode 2
+	  case 14003: // test Application Escape Mode 3
+	  case 14004: // test Application Escape Mode 4
+	    AppliEscapeMode = 0;
+	    break;
 	}
     }
 
@@ -3246,7 +3256,7 @@
 	      resp = 2;
 	    break;
 	  case 7727:	// MinTTY Application Escape Mode
-	    if (AppliEscapeMode)
+	    if (AppliEscapeMode == 1)
 	      resp = 1;
 	    else
 	      resp = 2;
@@ -3273,6 +3283,14 @@
 	    else
 	      resp = 2;
 	    break;
+	  case 14002:	// test Application Escape Mode 2
+	  case 14003:	// test Application Escape Mode 3
+	  case 14004:	// test Application Escape Mode 4
+	    if (AppliEscapeMode == Param[1] - 14000)
+	      resp = 1;
+	    else
+	      resp = 2;
+	    break;
 	}
 	break;
     }



Ttssh2-commit メーリングリストの案内
Back to archive index