[Ttssh2-commit] [7970] 入力キーコードをunicodeで扱う

Back to archive index
scmno****@osdn***** scmno****@osdn*****
2019年 8月 15日 (木) 23:05:18 JST


Revision: 7970
          https://osdn.net/projects/ttssh2/scm/svn/commits/7970
Author:   zmatsuo
Date:     2019-08-15 23:05:18 +0900 (Thu, 15 Aug 2019)
Log Message:
-----------
入力キーコードをunicodeで扱う

Modified Paths:
--------------
    branches/unicode_buf/teraterm/teraterm/vtwin.cpp

-------------- next part --------------
Modified: branches/unicode_buf/teraterm/teraterm/vtwin.cpp
===================================================================
--- branches/unicode_buf/teraterm/teraterm/vtwin.cpp	2019-08-15 14:05:04 UTC (rev 7969)
+++ branches/unicode_buf/teraterm/teraterm/vtwin.cpp	2019-08-15 14:05:18 UTC (rev 7970)
@@ -1743,7 +1743,6 @@
 void CVTWindow::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
 {
 	unsigned int i;
-	char Code;
 
 	if (!KeybEnabled || (TalkStatus!=IdTalkKeyb)) {
 		return;
@@ -1753,20 +1752,32 @@
 		::PostMessage(HVTWin,WM_SYSCHAR,nChar,MAKELONG(nRepCnt,nFlags));
 		return;
 	}
-	Code = nChar;
 
-	if ((ts.Language==IdRussian) &&
-	    ((BYTE)Code>=128)) {
-		Code = (char)RussConv(ts.RussKeyb,ts.RussClient,(BYTE)Code);
-	}
-
+#if UNICODE_INTERNAL_BUFF
 	for (i=1 ; i<=nRepCnt ; i++) {
-		CommTextOut(&cv,&Code,1);
+		wchar_t u16 = nChar;
+		CommTextOutW(&cv,&u16,1);
 		if (ts.LocalEcho>0) {
-			CommTextEcho(&cv,&Code,1);
+			CommTextEchoW(&cv,&u16,1);
 		}
 	}
+#else
+	{
+		char Code = nChar;
+		if ((ts.Language==IdRussian) &&
+			((BYTE)Code>=128)) {
+			Code = (char)RussConv(ts.RussKeyb,ts.RussClient,(BYTE)Code);
+		}
 
+		for (i=1 ; i<=nRepCnt ; i++) {
+			CommTextOut(&cv,&Code,1);
+			if (ts.LocalEcho>0) {
+				CommTextEcho(&cv,&Code,1);
+			}
+		}
+	}
+#endif
+
 	// \x83X\x83N\x83\x8D\x81[\x83\x8B\x88ʒu\x82\xF0\x83\x8A\x83Z\x83b\x83g
 	if (WinOrgY != 0) {
 		DispVScroll(SCROLL_BOTTOM, 0);


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