• R/O
  • SSH
  • HTTPS

ttssh2: Commit


Commit MetaInfo

Revision5784 (tree)
Time2015-02-21 17:25:23
Author(del#1144)

Log Message

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

http://sourceforge.jp/ticket/browse.php?group_id=1412&tid=34898
共有メモリの keycode map (pm->km) を使うのをやめた

Change Summary

Incremental Difference

--- trunk/teraterm/teraterm/keyboard.c (revision 5783)
+++ trunk/teraterm/teraterm/keyboard.c (revision 5784)
@@ -45,7 +45,13 @@
4545 char TempDir[MAXPATHLEN];
4646 char TempName[MAX_PATH];
4747
48+#ifdef SHARED_KEYMAP
4849 if ( strlen(ts.KeyCnfFN)==0 ) return;
50+#else
51+ if ( strlen(ts.KeyCnfFN)==0 ) {
52+ strncpy_s(ts.KeyCnfFN, sizeof(ts.KeyCnfFN),"KEYBOARD.CNF", _TRUNCATE);
53+ }
54+#endif
4955 ExtractFileName(ts.KeyCnfFN,TempName,sizeof(TempName));
5056 ExtractDirName(ts.KeyCnfFN,TempDir);
5157 if (TempDir[0]==0)
@@ -64,6 +70,7 @@
6470 (*ReadKeyboardCnf)(ts.KeyCnfFN, KeyMap, TRUE);
6571 FreeTTSET();
6672 }
73+#ifdef SHARED_KEYMAP
6774 if ((_stricmp(TempDir,ts.HomeDir)==0) &&
6875 (_stricmp(TempName,"KEYBOARD.CNF")==0))
6976 {
@@ -71,6 +78,7 @@
7178 free(KeyMap);
7279 KeyMap = NULL;
7380 }
81+#endif
7482 }
7583
7684 void ClearUserKey()
--- trunk/teraterm/teraterm/vtwin.cpp (revision 5783)
+++ trunk/teraterm/teraterm/vtwin.cpp (revision 5784)
@@ -512,10 +512,12 @@
512512 #ifdef ALPHABLEND_TYPE2
513513 DWORD ExStyle;
514514 #endif
515- char Temp[MAX_PATH];
516515 char *Param;
517516 int CmdShow;
517+#ifdef SHARED_KEYMAP
518+ char Temp[MAX_PATH];
518519 PKeyMap tempkm;
520+#endif
519521 int fuLoad = LR_DEFAULTCOLOR;
520522
521523 #ifdef _DEBUG
@@ -536,6 +538,7 @@
536538 if (LoadTTSET()) {
537539 /* read setup info from "teraterm.ini" */
538540 (*ReadIniFile)(ts.SetupFName, &ts);
541+#ifdef SHARED_KEYMAP
539542 /* read keycode map from "keyboard.cnf" */
540543 tempkm = (PKeyMap)malloc(sizeof(TKeyMap));
541544 if (tempkm!=NULL) {
@@ -544,7 +547,9 @@
544547 strncat_s(Temp,sizeof(Temp),"KEYBOARD.CNF",_TRUNCATE);
545548 (*ReadKeyboardCnf)(Temp,tempkm,TRUE);
546549 }
550+#endif
547551 FreeTTSET();
552+#ifdef SHARED_KEYMAP
548553 /* store default sets in TTCMN */
549554 #if 0
550555 ChangeDefaultSet(&ts,tempkm);
@@ -552,6 +557,7 @@
552557 ChangeDefaultSet(NULL,tempkm);
553558 #endif
554559 if (tempkm!=NULL) free(tempkm);
560+#endif
555561 }
556562
557563 } else {
@@ -559,6 +565,7 @@
559565 if (LoadTTSET()) {
560566 /* read setup info from "teraterm.ini" */
561567 (*ReadIniFile)(ts.SetupFName, &ts);
568+#ifdef SHARED_KEYMAP
562569 /* read keycode map from "keyboard.cnf" */
563570 tempkm = (PKeyMap)malloc(sizeof(TKeyMap));
564571 if (tempkm!=NULL) {
@@ -567,11 +574,14 @@
567574 strncat_s(Temp,sizeof(Temp),"KEYBOARD.CNF",_TRUNCATE);
568575 (*ReadKeyboardCnf)(Temp,tempkm,TRUE);
569576 }
577+#endif
570578 FreeTTSET();
579+#ifdef SHARED_KEYMAP
571580 /* store default sets in TTCMN */
572581 if (tempkm!=NULL) {
573582 free(tempkm);
574583 }
584+#endif
575585 }
576586
577587 }
Show on old repository browser