Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Changing culture (keys) of the keyboard? (Read 3225 times)
Chris M
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 17
Joined: Oct 7th, 2014
Changing culture (keys) of the keyboard?
May 6th, 2016 at 2:00pm
Print Post  
How do I change the culture (keys) of the keyboard?

I have a virtual keyboard and devexpress drop down on a form.  The drop down contains all of my installed cultures.  When a culture is chosen from the drop down this happens:

    private void comboBoxEdit1_SelectedIndexChanged(object sender, EventArgs e)
    {
      virtualKeyboard1.CurrentCulture = new CultureInfo((string)comboBoxEdit1.SelectedItem);
    }

However, the keyboard doesn’t change to the other culture.  Is there something else that needs to be done?

I cannot find documentation on this.

Thanks.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3204
Joined: Oct 19th, 2005
Re: Changing culture (keys) of the keyboard?
Reply #1 - May 6th, 2016 at 4:13pm
Print Post  
What Keyboard.Mode value are you using? If it's set to Custom, the control will try to load a layout file with culture's locale id in its name from LayoutsFolder. If using Default or Extended modes, the control should change key values and labels in current layout as long as it recognizes the culture (from list at http://www.mindfusion.eu/onlinehelp/keyboard.winforms/index.htm?Keyboard_Languag...).

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3204
Joined: Oct 19th, 2005
Re: Changing culture (keys) of the keyboard?
Reply #2 - May 9th, 2016 at 10:50am
Print Post  
There's actually a TemplateLayout property that lets you set a custom layout with culture-dependent keys too -

kb.TemplateLayout = KeyboardLayout.Create("custom_layout.xml");

If keyboard's AutoFill property is enabled, it will replace the 48 printable-character keys from TemplateLayout with ones from resources, without changing your custom positions (only assigning new virtual key codes to them). From what I can see in the code, it depends on the array order of keys being the same as one in standard layouts, so it might not work correctly if you create the custom layout by deleting printable-character keys from standard template.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint