diff options
author | hobbs <hobbs> | 2006-04-05 20:58:09 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2006-04-05 20:58:09 (GMT) |
commit | 951e01d3eae848c5c963f0e91a100d5c61c8867e (patch) | |
tree | df16d2f6ccc9466e6526cb68815ad3bbc6c7fc7e /win/tkWinX.c | |
parent | 126314d7ebaf845d3bc4d7d98853c3109cb21a21 (diff) | |
download | tk-951e01d3eae848c5c963f0e91a100d5c61c8867e.zip tk-951e01d3eae848c5c963f0e91a100d5c61c8867e.tar.gz tk-951e01d3eae848c5c963f0e91a100d5c61c8867e.tar.bz2 |
* win/tkWinX.c (TkWinXInit): init default keyboard charset
correctly. [Bug 1374119] (pajas)
Diffstat (limited to 'win/tkWinX.c')
-rw-r--r-- | win/tkWinX.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/win/tkWinX.c b/win/tkWinX.c index ce2230e..3a38aab 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.52 2005/12/02 13:42:29 dkf Exp $ + * RCS: @(#) $Id: tkWinX.c,v 1.53 2006/04/05 20:58:09 hobbs Exp $ */ /* @@ -245,6 +245,8 @@ TkWinXInit( HINSTANCE hInstance) { INITCOMMONCONTROLSEX comctl; + CHARSETINFO lpCs; + DWORD lpCP; if (childClassInitialized != 0) { return; @@ -298,6 +300,17 @@ TkWinXInit( } /* + * 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. */ @@ -1386,7 +1399,7 @@ GetTranslatedKey( * * UpdateInputLanguage -- * - * Gets called when a WM_INPUTLANGCHANGE message is received by the TK + * Gets called when a WM_INPUTLANGCHANGE message is received by the Tk * child window function. 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 |