[Ttssh2-commit] [7240] metaキーの扱いを正しくした

scmno****@osdn***** scmno****@osdn*****
2018年 9月 13日 (木) 23:58:52 JST


Revision: 7240
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/7240
Author:   zmatsuo
Date:     2018-09-13 23:58:51 +0900 (Thu, 13 Sep 2018)
Log Message:
-----------
metaキーの扱いを正しくした
システムメニュのメニューバー表示を動作するようにした

Modified Paths:
--------------
    branches/cmake/teraterm/teraterm/tekwin.cpp
    branches/cmake/teraterm/teraterm/teraterm.cpp
    branches/cmake/teraterm/teraterm/vtwin.cpp

-------------- next part --------------
Modified: branches/cmake/teraterm/teraterm/tekwin.cpp
===================================================================
--- branches/cmake/teraterm/teraterm/tekwin.cpp	2018-09-13 14:54:21 UTC (rev 7239)
+++ branches/cmake/teraterm/teraterm/tekwin.cpp	2018-09-13 14:58:51 UTC (rev 7240)
@@ -929,7 +929,7 @@
 		OnSize(wp, LOWORD(lp), HIWORD(lp));
 		break;
 	case WM_SYSCOMMAND:
-		OnSysCommand((wp & 0xFFF0), lp);
+		OnSysCommand(wp, lp);
 		TTCFrameWnd::Proc(msg, wp, lp);
 		break;
 	case WM_SYSKEYDOWN:

Modified: branches/cmake/teraterm/teraterm/teraterm.cpp
===================================================================
--- branches/cmake/teraterm/teraterm/teraterm.cpp	2018-09-13 14:54:21 UTC (rev 7239)
+++ branches/cmake/teraterm/teraterm/teraterm.cpp	2018-09-13 14:58:51 UTC (rev 7240)
@@ -219,14 +219,19 @@
 
 	MSG msg;
 	while (GetMessage(&msg, NULL, 0, 0)) {
+		bool message_processed = false;
 
-		if (MetaKey(ts.MetaKey)) {
-			continue;
+		if (m_pMainWnd->m_hAccel != NULL) {
+			if (!MetaKey(ts.MetaKey)) {
+				// matakey\x82\xAA\x89\x9F\x82\xB3\x82\xEA\x82Ă\xA2\x82Ȃ\xA2
+				if (TranslateAccelerator(m_pMainWnd->m_hWnd , m_pMainWnd->m_hAccel, &msg)) {
+					// \x83A\x83N\x83Z\x83\x89\x83\x8C\x81[\x83^\x81[\x83L\x81[\x82\xF0\x8F\x88\x97\x9D\x82\xB5\x82\xBD
+					message_processed = true;
+				}
+			}
 		}
 
-		if (m_pMainWnd->m_hAccel != NULL &&
-			!TranslateAccelerator(m_pMainWnd->m_hWnd , m_pMainWnd->m_hAccel, &msg))
-		{
+		if (!message_processed) {
 			TranslateMessage(&msg);
 			DispatchMessage(&msg);
 		}

Modified: branches/cmake/teraterm/teraterm/vtwin.cpp
===================================================================
--- branches/cmake/teraterm/teraterm/vtwin.cpp	2018-09-13 14:54:21 UTC (rev 7239)
+++ branches/cmake/teraterm/teraterm/vtwin.cpp	2018-09-13 14:58:51 UTC (rev 7240)
@@ -30,7 +30,6 @@
 
 /* TERATERM.EXE, VT window */
 
-//#include "stdafx.h"
 #include <winsock2.h>
 #include <ws2tcpip.h>
 #include "teraterm.h"
@@ -677,7 +676,6 @@
 #ifdef ALPHABLEND_TYPE2
 	DWORD ExStyle;
 #endif
-	char *Param;
 	int CmdShow;
 #ifdef SHARED_KEYMAP
 	char Temp[MAX_PATH];
@@ -761,8 +759,8 @@
 	/* Parse command line parameters*/
 	// 256\x83o\x83C\x83g\x88ȏ\xE3\x82̃R\x83}\x83\x93\x83h\x83\x89\x83C\x83\x93\x83p\x83\x89\x83\x81\x81[\x83^\x8Ew\x92肪\x82\xA0\x82\xE9\x82ƁABOF(Buffer Over Flow)\x82\xC5
 	// \x97\x8E\x82\xBF\x82\xE9\x83o\x83O\x82\xF0\x8FC\x90\xB3\x81B(2007.6.12 maya)
-	Param = GetCommandLine();
 	if (LoadTTSET()) {
+		LPTSTR Param = GetCommandLine();
 		(*ParseParam)(Param, &ts, &(TopicName[0]));
 	}
 	FreeTTSET();
@@ -6241,7 +6239,7 @@
 		break;
 #endif
 	case WM_SYSCOMMAND:
-		OnSysCommand((wp & 0xFFF0), lp);
+		OnSysCommand(wp, lp);
 		TTCFrameWnd::Proc(msg, wp, lp);
 		break;
 	case WM_SYSKEYDOWN:



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