[Ttssh2-commit] [5784] マクロから起動した場合、KEYBOARD.CNFが読み込まれない問題を修正

svnno****@sourc***** svnno****@sourc*****
2015年 2月 21日 (土) 17:25:24 JST


Revision: 5784
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/5784
Author:   maya
Date:     2015-02-21 17:25:23 +0900 (Sat, 21 Feb 2015)
Log Message:
-----------
マクロから起動した場合、KEYBOARD.CNFが読み込まれない問題を修正
  http://sourceforge.jp/ticket/browse.php?group_id=1412&tid=34898
  共有メモリの keycode map (pm->km) を使うのをやめた

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

-------------- next part --------------
Modified: trunk/teraterm/teraterm/keyboard.c
===================================================================
--- trunk/teraterm/teraterm/keyboard.c	2015-02-15 14:07:29 UTC (rev 5783)
+++ trunk/teraterm/teraterm/keyboard.c	2015-02-21 08:25:23 UTC (rev 5784)
@@ -45,7 +45,13 @@
   char TempDir[MAXPATHLEN];
   char TempName[MAX_PATH];
 
+#ifdef SHARED_KEYMAP
   if ( strlen(ts.KeyCnfFN)==0 ) return;
+#else
+  if ( strlen(ts.KeyCnfFN)==0 ) {
+    strncpy_s(ts.KeyCnfFN, sizeof(ts.KeyCnfFN),"KEYBOARD.CNF", _TRUNCATE);
+  }
+#endif
   ExtractFileName(ts.KeyCnfFN,TempName,sizeof(TempName));
   ExtractDirName(ts.KeyCnfFN,TempDir);
   if (TempDir[0]==0)
@@ -64,6 +70,7 @@
       (*ReadKeyboardCnf)(ts.KeyCnfFN, KeyMap, TRUE);
     FreeTTSET();
   }
+#ifdef SHARED_KEYMAP
   if ((_stricmp(TempDir,ts.HomeDir)==0) &&
       (_stricmp(TempName,"KEYBOARD.CNF")==0))
   {
@@ -71,6 +78,7 @@
      free(KeyMap);
      KeyMap = NULL;
   }
+#endif
 }
 
 void ClearUserKey()

Modified: trunk/teraterm/teraterm/vtwin.cpp
===================================================================
--- trunk/teraterm/teraterm/vtwin.cpp	2015-02-15 14:07:29 UTC (rev 5783)
+++ trunk/teraterm/teraterm/vtwin.cpp	2015-02-21 08:25:23 UTC (rev 5784)
@@ -512,10 +512,12 @@
 #ifdef ALPHABLEND_TYPE2
 	DWORD ExStyle;
 #endif
-	char Temp[MAX_PATH];
 	char *Param;
 	int CmdShow;
+#ifdef SHARED_KEYMAP
+	char Temp[MAX_PATH];
 	PKeyMap tempkm;
+#endif
 	int fuLoad = LR_DEFAULTCOLOR;
 
 #ifdef _DEBUG
@@ -536,6 +538,7 @@
 		if (LoadTTSET()) {
 			/* read setup info from "teraterm.ini" */
 			(*ReadIniFile)(ts.SetupFName, &ts);
+#ifdef SHARED_KEYMAP
 			/* read keycode map from "keyboard.cnf" */
 			tempkm = (PKeyMap)malloc(sizeof(TKeyMap));
 			if (tempkm!=NULL) {
@@ -544,7 +547,9 @@
 				strncat_s(Temp,sizeof(Temp),"KEYBOARD.CNF",_TRUNCATE);
 				(*ReadKeyboardCnf)(Temp,tempkm,TRUE);
 			}
+#endif
 			FreeTTSET();
+#ifdef SHARED_KEYMAP
 			/* store default sets in TTCMN */
 #if 0
 			ChangeDefaultSet(&ts,tempkm);
@@ -552,6 +557,7 @@
 			ChangeDefaultSet(NULL,tempkm);
 #endif
 			if (tempkm!=NULL) free(tempkm);
+#endif
 		}
 
 	} else {
@@ -559,6 +565,7 @@
 		if (LoadTTSET()) {
 			/* read setup info from "teraterm.ini" */
 			(*ReadIniFile)(ts.SetupFName, &ts);
+#ifdef SHARED_KEYMAP
 			/* read keycode map from "keyboard.cnf" */
 			tempkm = (PKeyMap)malloc(sizeof(TKeyMap));
 			if (tempkm!=NULL) {
@@ -567,11 +574,14 @@
 				strncat_s(Temp,sizeof(Temp),"KEYBOARD.CNF",_TRUNCATE);
 				(*ReadKeyboardCnf)(Temp,tempkm,TRUE);
 			}
+#endif
 			FreeTTSET();
+#ifdef SHARED_KEYMAP
 			/* store default sets in TTCMN */
 			if (tempkm!=NULL) {
 				free(tempkm);
 			}
+#endif
 		}
 
 	}



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