PDA

View Full Version : international input (keyboard) locales


Unregistered
November 5, 2002, 15:17:58
My default system locale is Greek. The default input (keyboard ) locale is English.

Whenever Text control is somehow activated, it changes the input (keyboard ) locale to Greek. Is there any way to avoid this automatic change?


This message was originally posted by Petros Katsinavakis in the old TX Text Control Support Forum.

Björn Meyer
November 5, 2002, 18:09:15
Hello Petros

1. Text Control uses Arial as the default font.
2. During creation Text Control gets the character set of the currently set
Windows system font. When this character set is contained in the Arial
font, it uses Arial, otherwise it uses a default font of that character
set.
3. Text Control compares the character set of the selected font with the
currently selected keyboard layout and changes the layout when not
equal.
4. When you manually change the keyboard layout after creating a control,
Text Control adapts the font.
5. When you manually change the font, Text Control adapts automatically the
keyboard layout.

e.G. aWhen your keyboard layout changes from Greek to English during
creation, this means that your Windows system font is English. The only
way to initialize another keyboard layout is to change the font
immediately after creating the control with the FontName property (or
the TX_SETFONT message when you use the DLL interface). This new font
must be a Greek font.

Björn Meyer, TX Text Control


This message was originally posted by Björn Meyer in the old TX Text Control Support Forum.

masood
January 9, 2004, 07:57:28
Dear Bjorn,

I have exactly the same automatic keyboard switching problem as described by Petros.

Can you please let me know if there is already a solution to this problem?

Setting the font to Arial is not a satisfactory solution.

Thanks

Masood

jc009837
December 30, 2004, 17:53:46
I had a similar problem with the Text Control and instead of switching the font I used windows functions to determine the current KeyBoard layout and then after the Text Control Loaded I would check the layout again and if it chaned I would change it back to what it was originally. The following code shows how to do this in VC

//Get the keyboard layout before creating the Text Control.
HKL layout = GetKeyboardLayout(0);

...Create the Text Control...

//Force the messages from Text Control to be processed then reset the keyboard layout.
MSG msg;
while (PeekMessage(&msg, m_TX.GetSafeHwnd(), 0, 0, PM_REMOVE))
DispatchMessage(&msg);

HKL layoutAfter = GetKeyboardLayout(0);
if(layout != layoutAfter)
{
ActivateKeyboardLayout(layout, NULL);
}

I also discovered a couple of other functions in the TextControl that could cause the KeyboardLayout to change and the same code was used there.

Hope this Helps.

Josh