The MindFusion Forums | |
Virtual Keyboard Components >> WPF >> Change language is slow and cause dialog to disappear
https://mindfusion.eu/Forum/YaBB.pl?num=1539258222 Message started by Frank Knudsen on Oct 11th, 2018 at 11:43am |
Title: Change language is slow and cause dialog to disappear Post by Frank Knudsen on Oct 11th, 2018 at 11:43am
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. |
Title: Re: Change language is slow and cause dialog to disappear Post by Slavcho on Oct 11th, 2018 at 5:47pm
Hi,
Quote:
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:
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:
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 |
The MindFusion Forums » Powered by YaBB 2.6.11! YaBB Forum Software © 2000-2024. All Rights Reserved. |