Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Change language is slow and cause dialog to disappear (Read 1990 times)
Frank Knudsen
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 1
Joined: Oct 11th, 2018
Change language is slow and cause dialog to disappear
Oct 11th, 2018 at 11:43am
Print Post  
Hi.

I'm trying out the virtual keyboard and has embedded it on a dialog in my application. I have set it up to use custom layout and for multiple languages. I have the following languages available in the operating system (windows 10) English, Danish, German, French and Swedish. The first time the change language button on the keyboard is pressed, it takes several seconds before the language changes and sometimes the dialog disappears until the touch screen is pressed then the dialog is shown again.

1. When the language of the keyboard is changed, it seems that the windows 10 keyboard is also changed, is there a way to avoid this?
2. Is it possible to "preload" the language change function in the keyboard so that it does not take that long time?
3. Is there a way to work around the issue with the disappearing dialog, some event that I can use to bring the dialog into focus again?


The XAML code looks like this:

     <StackPanel HorizontalAlignment="Left" Height="Auto" VerticalAlignment="Top">
        <TextBox    x:Name="NumberValue"
                    Height="86"
                    Text="{Binding Value, Mode=TwoWay}"
                    IsReadOnly="False"
                    TextWrapping="Wrap"
                    TextAlignment="Center"/>
        <kthemes:ColorSchemeChanger Width="100" x:Name="themeSelector"/>
        <Grid>
            <vk:VirtualKeyboard x:Name="VK"
                                IsStandAlone="False"
                                AutoFill="True"
                                KeyPressed="VK_KeyPressed"
                                Margin="8"/>
        </Grid>
    </StackPanel>



And the code behind:


        public D12_EditTextView(ID12_EditTextViewModel viewModel)
        {
            ViewModel = viewModel;
            InitializeComponent();
            NumberValue.Focus();
            themeSelector.Visibility = System.Windows.Visibility.Collapsed;
            themeSelector.SelectedIndex = 7;

            VK.LayoutsFolder = Directory.GetCurrentDirectory() + @"\KeyLayouts\";
            
            // Check that the folder exist and it has at least 1 file in it
            if (Directory.Exists(VK.LayoutsFolder) && Directory.GetFileSystemEntries(VK.LayoutsFolder).Length > 0)
            {
                VK.Mode = MindFusion.UI.Wpf.KeyboardMode.Custom;
            }
            else
            {
                // Hide the keyboard because it is not configured correctly
                VK.Visibility = System.Windows.Visibility.Hidden;
            }
        }

        private void VK_KeyPressed(object sender, MindFusion.UI.Wpf.VirtualKeyEventArgs e)
        {
            NumberValue.Focus();
        }


Best regards
Frank.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: Change language is slow and cause dialog to disappear
Reply #1 - Oct 11th, 2018 at 5:47pm
Print Post  
Hi,

Quote:
1. When the language of the keyboard is changed, it seems that the windows 10 keyboard is also changed, is there a way to avoid this?

There isn't when using RegularKey keys, as they rely on Windows current language to map virtual key codes to characters. It should be possible with the UnicodeKey class from v4.5 (https://mindfusion.eu/Forum/YaBB.pl?num=1531381136).

Quote:
2. Is it possible to "preload" the language change function in the keyboard so that it does not take that long time?

Try running through a profiler first to see what exactly causes the delay. Loading a layout file shouldn't take that much time, but changing input language could cause loading resource assemblies etc. Otherwise you could probably pre-load / cache by cycling though your languages and assigning them to keyboard.InputLocale property, e.g. during application's startup.

Quote:
3. Is there a way to work around the issue with the disappearing dialog, some event that I can use to bring the dialog into focus again?

We are not hiding dialogs on purpose so I can't say how to show yours back. If you attach a test project reproducing that, our developer will investigate.

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