[Ttssh2-commit] [4293] Wheel - Cursor 変換を制御シーケンスで無効に出来るようにした。 ( mintty互換 )

アーカイブの一覧に戻る

svnno****@sourc***** svnno****@sourc*****
2011年 2月 7日 (月) 09:42:18 JST


Revision: 4293
          http://sourceforge.jp/projects/ttssh2/svn/view?view=rev&revision=4293
Author:   doda
Date:     2011-02-07 09:42:18 +0900 (Mon, 07 Feb 2011)

Log Message:
-----------
Wheel - Cursor 変換を制御シーケンスで無効に出来るようにした。(mintty互換)

Modified Paths:
--------------
    trunk/teraterm/teraterm/vtterm.c
    trunk/teraterm/teraterm/vtterm.h
    trunk/teraterm/teraterm/vtwin.cpp


-------------- next part --------------
Modified: trunk/teraterm/teraterm/vtterm.c
===================================================================
--- trunk/teraterm/teraterm/vtterm.c	2011-02-05 14:24:00 UTC (rev 4292)
+++ trunk/teraterm/teraterm/vtterm.c	2011-02-07 00:42:18 UTC (rev 4293)
@@ -70,6 +70,8 @@
 
 static int VTlevel;
 
+BOOL AcceptWheelToCursor;
+
 // save/restore cursor
 typedef struct {
   int CursorX, CursorY;
@@ -214,6 +216,7 @@
   AppliKeyMode = FALSE;
   AppliCursorMode = FALSE;
   AppliEscapeMode = FALSE;
+  AcceptWheelToCursor = ts.TranslateWheelToCursor;
   RelativeOrgMode = FALSE;
   ts.ColorFlag &= ~CF_REVERSEVIDEO;
   AutoRepeatMode = TRUE;
@@ -2395,6 +2398,11 @@
 	  case 7727: // mintty Application Escape Mode
 	    AppliEscapeMode = TRUE;
 	    break;
+	  case 7786: // Wheel to Cursor translation
+	    if (ts.TranslateWheelToCursor) {
+	      AcceptWheelToCursor = TRUE;
+	    }
+	    break;
 	}
     }
 
@@ -2514,6 +2522,9 @@
 	  case 7727: // mintty Application Escape Mode
 	    AppliEscapeMode = FALSE;
 	    break;
+	  case 7786: // Wheel to Cursor translation
+	    AcceptWheelToCursor = FALSE;
+	    break;
 	}
     }
 
@@ -2551,6 +2562,7 @@
     AppliKeyMode = FALSE;
     AppliCursorMode = FALSE;
     AppliEscapeMode = FALSE;
+    AcceptWheelToCursor = ts.TranslateWheelToCursor;
     if ((StatusLine>0) &&
 	(CursorY == NumOfLines-1))
       MoveToMainScreen();
@@ -4460,6 +4472,10 @@
 	return BracketedPaste;
 }
 
+BOOL WheelToCursorMode() {
+	return AcceptWheelToCursor && AppliCursorMode && !ts.DisableAppCursor && !(ControlKey() && ts.DisableWheelToCursorByCtrl);
+}
+
 void ChangeTerminalID() {
   switch (ts.TerminalID) {
   case IdVT220J:

Modified: trunk/teraterm/teraterm/vtterm.h
===================================================================
--- trunk/teraterm/teraterm/vtterm.h	2011-02-05 14:24:00 UTC (rev 4292)
+++ trunk/teraterm/teraterm/vtterm.h	2011-02-07 00:42:18 UTC (rev 4293)
@@ -18,6 +18,7 @@
 void FocusReport(BOOL Focus);
 BOOL MouseReport(int Event, int Button, int Xpos, int Ypos);
 BOOL BracketedPasteMode();
+BOOL WheelToCursorMode();
 void EndTerm();
 void ChangeTerminalID();
 

Modified: trunk/teraterm/teraterm/vtwin.cpp
===================================================================
--- trunk/teraterm/teraterm/vtwin.cpp	2011-02-05 14:24:00 UTC (rev 4292)
+++ trunk/teraterm/teraterm/vtwin.cpp	2011-02-07 00:42:18 UTC (rev 4293)
@@ -2202,8 +2202,7 @@
 	if (MouseReport(IdMouseEventWheel, zDelta<0, pt.x, pt.y))
 		return TRUE;
 
-	if (ts.TranslateWheelToCursor && AppliCursorMode && !ts.DisableAppCursor &&
-	    !(ControlKey() && ts.DisableWheelToCursorByCtrl)) {
+	if (WheelToCursorMode()) {
 		if (zDelta < 0) {
 			KeyDown(HVTWin, VK_DOWN, line, MapVirtualKey(VK_DOWN, 0) | 0x100);
 			KeyUp(VK_DOWN);



Ttssh2-commit メーリングリストの案内
アーカイブの一覧に戻る