[Ttssh2-commit] [3987] マウストラッキングモードのモーションイベントに正式対応。

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2010年 8月 12日 (木) 18:05:46 JST


Revision: 3987
          http://sourceforge.jp/projects/ttssh2/svn/view?view=rev&revision=3987
Author:   doda
Date:     2010-08-12 18:05:46 +0900 (Thu, 12 Aug 2010)

Log Message:
-----------
マウストラッキングモードのモーションイベントに正式対応。
これにより、マウストラッキングモード中はマウスによる選択が出来なくなる。

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


-------------- next part --------------
Modified: trunk/teraterm/teraterm/vtterm.c
===================================================================
--- trunk/teraterm/teraterm/vtterm.c	2010-08-11 14:33:26 UTC (rev 3986)
+++ trunk/teraterm/teraterm/vtterm.c	2010-08-12 09:05:46 UTC (rev 3987)
@@ -3651,6 +3651,7 @@
 BOOL MouseReport(int Event, int Button, int Xpos, int Ypos) {
   char Report[10];
   int x, y, len, modifier;
+  static int LastX = -1, LastY = -1, LastButton = 3;
 
   len = 0;
 
@@ -3695,6 +3696,7 @@
 	case IdMouseTrackBtnEvent:
 	case IdMouseTrackAllEvent:
 	  len = MakeMouseReportStr(Report, sizeof Report, Button | modifier, x, y);
+	  LastButton = Button;
 	  break;
 
 	case IdMouseTrackDECELR: /* not supported yet */
@@ -3707,13 +3709,10 @@
     case IdMouseEventBtnUp:
       switch (MouseReportMode) {
 	case IdMouseTrackVT200:
-	  len = MakeMouseReportStr(Report, sizeof Report, 3 | modifier, x, y);
-	  break;
-
 	case IdMouseTrackBtnEvent:
 	case IdMouseTrackAllEvent:
-	  MouseReport(IdMouseEventMove, Button, Xpos, Ypos);
 	  len = MakeMouseReportStr(Report, sizeof Report, 3 | modifier, x, y);
+	  LastButton = 3; // Release
 	  break;
 
 	case IdMouseTrackX10: /* nothing to do */
@@ -3726,9 +3725,18 @@
 
     case IdMouseEventMove:
       switch (MouseReportMode) {
-	case IdMouseTrackBtnEvent: /* not supported yet */
-	case IdMouseTrackAllEvent: /* not supported yet */
-	  len = MakeMouseReportStr(Report, sizeof Report, Button | modifier | 32, x, y);
+	case IdMouseTrackBtnEvent:
+	  if (LastButton == 3) {
+	    return FALSE;
+	  }
+	  /* FALLTHROUGH */
+	case IdMouseTrackAllEvent:
+	  if (x == LastX && y == LastY) {
+	    return FALSE;
+	  }
+	  len = MakeMouseReportStr(Report, sizeof Report, LastButton | modifier | ((LastButton==3)?0:32), x, y);
+	  LastX = x;
+	  LastY = y;
 	  break;
 
 	case IdMouseTrackDECELR: /* not supported yet */

Modified: trunk/teraterm/teraterm/vtwin.cpp
===================================================================
--- trunk/teraterm/teraterm/vtwin.cpp	2010-08-11 14:33:26 UTC (rev 3986)
+++ trunk/teraterm/teraterm/vtwin.cpp	2010-08-12 09:05:46 UTC (rev 3987)
@@ -851,7 +851,9 @@
 		return;
 	}
 
-	mousereport = MouseReport(IdMouseEventBtnDown, LMR, p.x, p.y);
+	if (mousereport = MouseReport(IdMouseEventBtnDown, LMR, p.x, p.y)) {
+		return;
+	}
 
 	// added ConfirmPasteMouseRButton (2007.3.17 maya)
 	if ((LMR == IdRightButton) &&
@@ -2140,13 +2142,20 @@
 void CVTWindow::OnMouseMove(UINT nFlags, CPoint point)
 {
 	int i;
+	BOOL mousereport;
 
+	mousereport = MouseReport(IdMouseEventMove, 0, point.x, point.y);
+
 	if (! (LButton || MButton || RButton)) {
 		// ƒ}ƒEƒXƒJ[ƒ\ƒ‹’¼‰º‚ÉURL•¶Žš—ñ‚ª‚ ‚é‚©‚𑖍¸‚·‚é (2005.4.2 yutaka)
 		BuffChangeSelect(point.x, point.y,0);
 		return;
 	}
 
+	if (mousereport) {
+		return;
+	}
+
 	if (DblClk) {
 		i = 2;
 	}



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