diff options
author | hobbs <hobbs@noemail.net> | 2006-04-05 19:48:23 (GMT) |
---|---|---|
committer | hobbs <hobbs@noemail.net> | 2006-04-05 19:48:23 (GMT) |
commit | 517d4cd31a92f318980d220139b925d6e844b852 (patch) | |
tree | 586010a572b688d822e697526edaa459aabc5daa /win | |
parent | 725b30850ec02f009012b1eaab6e860283d2d332 (diff) | |
download | tk-517d4cd31a92f318980d220139b925d6e844b852.zip tk-517d4cd31a92f318980d220139b925d6e844b852.tar.gz tk-517d4cd31a92f318980d220139b925d6e844b852.tar.bz2 |
* win/tkWinX.c (TkWinXInit): init default keyboard charset
correctly. [Bug 1374119] (pajas)
FossilOrigin-Name: f42bca1147263ff4027bc4df876be4225bdafa60
Diffstat (limited to 'win')
-rw-r--r-- | win/tkWinX.c | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/win/tkWinX.c b/win/tkWinX.c index 4b28faa..39339c9 100644 --- a/win/tkWinX.c +++ b/win/tkWinX.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinX.c,v 1.25.2.6 2005/02/28 22:10:26 hobbs Exp $ + * RCS: @(#) $Id: tkWinX.c,v 1.25.2.7 2006/04/05 19:48:23 hobbs Exp $ */ #include "tkWinInt.h" @@ -226,6 +226,9 @@ void TkWinXInit(hInstance) HINSTANCE hInstance; { + CHARSETINFO lpCs; + DWORD lpCP; + if (childClassInitialized != 0) { return; } @@ -281,6 +284,17 @@ TkWinXInit(hInstance) } /* + * Initialize input language info + */ + + if (GetLocaleInfo(LANGIDFROMLCID(GetKeyboardLayout(0)), + LOCALE_IDEFAULTANSICODEPAGE | LOCALE_RETURN_NUMBER, + (LPTSTR) &lpCP, sizeof(lpCP)/sizeof(TCHAR)) + && TranslateCharsetInfo((DWORD *)lpCP, &lpCs, TCI_SRCCODEPAGE)) { + UpdateInputLanguage(lpCs.ciCharset); + } + + /* * Make sure we cleanup on finalize. */ TkCreateExitHandler(TkWinXCleanup, (ClientData) hInstance); @@ -1355,13 +1369,12 @@ GetTranslatedKey(xkey) * * UpdateInputLanguage -- * - * Gets called when a WM_INPUTLANGCHANGE message is received - * by the TK child window procedure. This message is sent - * by the Input Method Editor system when the user chooses - * a different input method. All subsequent WM_CHAR - * messages will contain characters in the new encoding. We record - * the new encoding so that TkpGetString() knows how to - * correctly translate the WM_CHAR into unicode. + * Gets called when a WM_INPUTLANGCHANGE message is received by the Tk + * child window procedure. This message is sent by the Input Method + * Editor system when the user chooses a different input method. All + * subsequent WM_CHAR messages will contain characters in the new + * encoding. We record the new encoding so that TkpGetString() knows how + * to correctly translate the WM_CHAR into unicode. * * Results: * Records the new encoding in keyInputEncoding. |