Revision: 9246 https://osdn.net/projects/ttssh2/scm/svn/commits/9246 Author: zmatsuo Date: 2021-05-10 23:12:22 +0900 (Mon, 10 May 2021) Log Message: ----------- キーボードに関する内部情報を keyboard_i.h にまとめた - teraterm/teraterm/keyboard_i.hを追加 - キーボード内部情報の参照範囲を限定した - teraterm/common/tttypes_key.h から参照しないようにした - 次のファイルから include - teraterm/teraterm/keyboard.c - teraterm/ttpset/ttset_keyboard.c Modified Paths: -------------- trunk/teraterm/common/tttypes_key.h trunk/teraterm/teraterm/keyboard.c trunk/teraterm/teraterm/ttsetup.h trunk/teraterm/ttpset/ttset_keyboard.c Added Paths: ----------- trunk/teraterm/teraterm/keyboard_i.h -------------- next part -------------- Modified: trunk/teraterm/common/tttypes_key.h =================================================================== --- trunk/teraterm/common/tttypes_key.h 2021-05-10 14:12:12 UTC (rev 9245) +++ trunk/teraterm/common/tttypes_key.h 2021-05-10 14:12:22 UTC (rev 9246) @@ -130,21 +130,3 @@ #define IdCmdDisconnect 1000 #define IdCmdLoadKeyMap 1001 #define IdCmdRestoreSetup 1002 - -#define KeyStrMax 1023 - -// (user) key type IDs -#define IdBinary 0 // transmit text without any modification -#define IdText 1 // transmit text with new-line & DBCS conversions -#define IdMacro 2 // activate macro -#define IdCommand 3 // post a WM_COMMAND message - -typedef struct { - WORD Map[IdKeyMax]; - /* user key str position/length in buffer */ - int UserKeyPtr[NumOfUserKey], UserKeyLen[NumOfUserKey]; - BYTE UserKeyStr[KeyStrMax+1]; - /* user key type */ - BYTE UserKeyType[NumOfUserKey]; -} TKeyMap; -typedef TKeyMap *PKeyMap; Modified: trunk/teraterm/teraterm/keyboard.c =================================================================== --- trunk/teraterm/teraterm/keyboard.c 2021-05-10 14:12:12 UTC (rev 9245) +++ trunk/teraterm/teraterm/keyboard.c 2021-05-10 14:12:22 UTC (rev 9246) @@ -43,6 +43,7 @@ #include "ttdde.h" #include "keyboard.h" +#include "keyboard_i.h" BOOL AutoRepeatMode; BOOL AppliKeyMode; Copied: trunk/teraterm/teraterm/keyboard_i.h (from rev 9245, trunk/teraterm/teraterm/ttsetup.h) =================================================================== --- trunk/teraterm/teraterm/keyboard_i.h (rev 0) +++ trunk/teraterm/teraterm/keyboard_i.h 2021-05-10 14:12:22 UTC (rev 9246) @@ -0,0 +1,48 @@ +/* + * (C) 2021- TeraTerm Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#pragma once + +#define KeyStrMax 1023 + +// (user) key type IDs +#define IdBinary 0 // transmit text without any modification +#define IdText 1 // transmit text with new-line & DBCS conversions +#define IdMacro 2 // activate macro +#define IdCommand 3 // post a WM_COMMAND message + +struct TKeyMap_st { + WORD Map[IdKeyMax]; + /* user key str position/length in buffer */ + int UserKeyPtr[NumOfUserKey], UserKeyLen[NumOfUserKey]; + BYTE UserKeyStr[KeyStrMax+1]; + /* user key type */ + BYTE UserKeyType[NumOfUserKey]; +}; +typedef struct TKeyMap_st *PKeyMap; +typedef struct TKeyMap_st TKeyMap; Modified: trunk/teraterm/teraterm/ttsetup.h =================================================================== --- trunk/teraterm/teraterm/ttsetup.h 2021-05-10 14:12:12 UTC (rev 9245) +++ trunk/teraterm/teraterm/ttsetup.h 2021-05-10 14:12:22 UTC (rev 9246) @@ -30,7 +30,6 @@ #pragma once #include "ttlib.h" -#include "tttypes_key.h" /* TERATERM.EXE, TTSET interface */ #ifdef __cplusplus @@ -37,6 +36,10 @@ extern "C" { #endif +// ReadKeyboardCnf \x82̈\xF8\x90\x94\x82̌^ +// \x8E\xC0\x8Dۂ̌^\x82\xCD tttypes_key.h \x82\xF0 include +typedef struct TKeyMap_st *PKeyMap; + typedef void (PASCAL *PReadIniFile) (PCHAR FName, PTTSet ts); typedef void (PASCAL *PWriteIniFile) Modified: trunk/teraterm/ttpset/ttset_keyboard.c =================================================================== --- trunk/teraterm/ttpset/ttset_keyboard.c 2021-05-10 14:12:12 UTC (rev 9245) +++ trunk/teraterm/ttpset/ttset_keyboard.c 2021-05-10 14:12:22 UTC (rev 9246) @@ -33,7 +33,7 @@ #include <string.h> #include "ttlib.h" #include "codeconv.h" -#include "tttypes_key.h" +#include "../teraterm/keyboard_i.h" #define INI_FILE_IS_UNICODE 1