[Ttssh2-commit] [4420] NetTerm 形式のマウスボタン通知に対応

svnno****@sourc***** svnno****@sourc*****
2011年 4月 8日 (金) 12:08:20 JST


Revision: 4420
          http://sourceforge.jp/projects/ttssh2/svn/view?view=rev&revision=4420
Author:   doda
Date:     2011-04-08 12:08:19 +0900 (Fri, 08 Apr 2011)

Log Message:
-----------
NetTerm 形式のマウスボタン通知に対応
NetTerm 形式には有効化/無効化する為の制御シーケンスが無い為、暫定で DECSET/DECRST の 14001 で有効/無効に出来るようにした。

[.vimrc]
set mouse=a
set ttymouse=netterm
let &t_ti .= "\e[?14001h"
let &t_te .= "\e[?14001l"

# 左ボタンダウンイベントしか無いためドラッグによる選択が出来ないので、あまり使い勝手は良くない

Modified Paths:
--------------
    trunk/doc/en/html/about/history.html
    trunk/doc/ja/html/about/history.html
    trunk/teraterm/common/tttypes.h
    trunk/teraterm/teraterm/vtterm.c


-------------- next part --------------
Modified: trunk/doc/en/html/about/history.html
===================================================================
--- trunk/doc/en/html/about/history.html	2011-04-08 02:41:15 UTC (rev 4419)
+++ trunk/doc/en/html/about/history.html	2011-04-08 03:08:19 UTC (rev 4420)
@@ -45,6 +45,7 @@
       <li>The /k option is inherited by using the Duplicate Session. cf. <a href="http://sourceforge.jp/ticket/browse.php?group_id=1412&tid=24682">/k inheritance in "new session"</a></li>
       <!-- li>DEC “ÁŽê•¶Žš‚̃tƒHƒ“ƒg‚ɍ‚‹P“x/‰ºü‘®«‚𔽉f‚·‚é‚悤‚É‚µ‚½B</li -->
       <!-- li>Meta Key ‚̐ݒè‚ŁA¶Alt‚â‰EAlt‚Ì‚ÝMeta Key‚ɐݒè‚Å‚«‚é‚悤‚É‚µ‚½B</li -->
+      <li>added support for the NetTerm style mouse event tracking.</li>
     </ul>
   </li>
 

Modified: trunk/doc/ja/html/about/history.html
===================================================================
--- trunk/doc/ja/html/about/history.html	2011-04-08 02:41:15 UTC (rev 4419)
+++ trunk/doc/ja/html/about/history.html	2011-04-08 03:08:19 UTC (rev 4420)
@@ -45,6 +45,7 @@
       <li>ƒZƒbƒVƒ‡ƒ“•¡»‚ðs‚¤ÛA/K= ‚ª‚ ‚ê‚Έø‚«Œp‚¬‚ðs‚¤‚悤‚É‚µ‚½B cf. <a href="http://sourceforge.jp/ticket/browse.php?group_id=1412&tid=24682">/k inheritance in "new session"</a></li>
       <li>DEC “ÁŽê•¶Žš‚̃tƒHƒ“ƒg‚ɍ‚‹P“x/‰ºü‘®«‚𔽉f‚·‚é‚悤‚É‚µ‚½B</li>
       <li>Meta Key ‚̐ݒè‚ŁA¶Alt‚â‰EAlt‚Ì‚ÝMeta Key‚ɐݒè‚Å‚«‚é‚悤‚É‚µ‚½B</li>
+      <li>NetTerm Œ`Ž®‚̃}ƒEƒXƒCƒxƒ“ƒg’Ê’m‚ɑΉž‚µ‚½B</li>
     </ul>
   </li>
 

Modified: trunk/teraterm/common/tttypes.h
===================================================================
--- trunk/teraterm/common/tttypes.h	2011-04-08 02:41:15 UTC (rev 4419)
+++ trunk/teraterm/common/tttypes.h	2011-04-08 03:08:19 UTC (rev 4420)
@@ -577,6 +577,7 @@
 #define IdMouseTrackVT200Hl  4  // not supported
 #define IdMouseTrackBtnEvent 5
 #define IdMouseTrackAllEvent 6
+#define IdMouseTrackNetTerm  7
 
   /* Mouse event */
 #define IdMouseEventCurStat  0

Modified: trunk/teraterm/teraterm/vtterm.c
===================================================================
--- trunk/teraterm/teraterm/vtterm.c	2011-04-08 02:41:15 UTC (rev 4419)
+++ trunk/teraterm/teraterm/vtterm.c	2011-04-08 03:08:19 UTC (rev 4420)
@@ -2409,6 +2409,10 @@
 	      AcceptWheelToCursor = TRUE;
 	    }
 	    break;
+	  case 14001: // NetTerm mouse mode
+	    if (ts.MouseEventTracking)
+	      MouseReportMode = IdMouseTrackNetTerm;
+	    break;
 	}
     }
 
@@ -2535,6 +2539,9 @@
 	  case 7786: // Wheel to Cursor translation
 	    AcceptWheelToCursor = FALSE;
 	    break;
+	  case 14001: // NetTerm mouse mode
+	    MouseReportMode = IdMouseTrackNone;
+	    break;
 	}
     }
 
@@ -4348,7 +4355,7 @@
   if (x < 1) x = 1;
   if (y < 1) y = 1;
 
-  if (MouseReportMode != IdMouseTrackDECELR) {
+  if (MouseReportMode != IdMouseTrackDECELR && MouseReportMode != IdMouseTrackNetTerm) {
     if (x > 0xff - 32) x = 0xff - 32;
     if (y > 0xff - 32) y = 0xff - 32;
   }
@@ -4382,6 +4389,11 @@
 	  LastButton = Button;
 	  break;
 
+	case IdMouseTrackNetTerm:
+	  len = _snprintf_s_l(Report, sizeof Report, _TRUNCATE, "\033}%d,%d\r", CLocale, y, x);
+	  CommBinaryOut(&cv, Report, len);
+	  return TRUE;
+
 	case IdMouseTrackVT200Hl: /* not supported yet */
 	default:
 	  return FALSE;
@@ -4400,6 +4412,7 @@
 	  break;
 
 	case IdMouseTrackX10: /* nothing to do */
+	case IdMouseTrackNetTerm: /* nothing to do */
 	case IdMouseTrackVT200Hl: /* not supported yet */
 	default:
 	  return FALSE;
@@ -4425,6 +4438,7 @@
 	case IdMouseTrackVT200Hl: /* not supported yet */
 	case IdMouseTrackX10: /* nothing to do */
 	case IdMouseTrackVT200: /* nothing to do */
+	case IdMouseTrackNetTerm: /* nothing to do */
 	default:
 	  return FALSE;
       }
@@ -4440,6 +4454,7 @@
 
 	case IdMouseTrackX10: /* nothing to do */
 	case IdMouseTrackVT200Hl: /* not supported yet */
+	case IdMouseTrackNetTerm: /* nothing to do */
 	  return FALSE;
       }
       break;



Ttssh2-commit メーリングリストの案内