Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Embedded virtual keyboard changes focus (Read 1860 times)
Bleary Eye
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 14
Joined: Aug 17th, 2017
Embedded virtual keyboard changes focus
Jun 20th, 2020 at 10:42pm
Print Post  
I have a virtual keyboard as an embedded component in WPF. Whenever I click on a key, it changes the focus to the program that started it and sends the keystroke there. If run from Visual Studio, that gains focus; if run from Explorer, that gets it.

Here's the XAML, which sets all the properties. Any ideas?

Code (HTML)
Select All
                       <vk:VirtualKeyboard
                            Name="Vk"
                            TemplateLayout="{Binding Path=TemplateLayout, UpdateSourceTrigger=PropertyChanged}"
                            LayoutUpdated="{tools:MethodBinding Vk_LayoutUpdated}"
                            Height="{Binding Value, ElementName=VkSlider}"
                            Width="{Binding VkWidth, UpdateSourceTrigger=PropertyChanged}"
                            IsStandAlone="False"
                            Focusable="False"
                            >
                            <vk:VirtualKeyboard.FontFamily>
                                Gotham Medium,
                                Calibri,
                                Courier New
                            </vk:VirtualKeyboard.FontFamily>
                        </vk:VirtualKeyboard>
 

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


tech.support

Posts: 3153
Joined: Oct 19th, 2005
Re: Embedded virtual keyboard changes focus
Reply #1 - Jun 22nd, 2020 at 4:18pm
Print Post  
Try comparing your setup with CommonAPI sample project, it lets us type immediately into sample's textbox regardless of where started from. Also check this part from 4.5 release (https://mindfusion.eu/Forum/YaBB.pl?num=1541429322) -

Quote:
Pressing a key no longer activates last target window, which was necessary when keyboard is used as a popup inside application but led to activation flickering. Set the new PreventActivation property instead to disable the keyboard's popup window from activating altogether.
  
Back to top
 
IP Logged
 
Bleary Eye
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 14
Joined: Aug 17th, 2017
Re: Embedded virtual keyboard changes focus
Reply #2 - Jun 23rd, 2020 at 12:23pm
Print Post  
That worked, thanks.

I was using virtual keyboard v. 4.4.2 and had to update to 4.5. For anyone reading this, that turned out to be kind of hard. After considerable thrashing about, I finally uninstalled virtual keyboard completely and then installed v. 4.5. Then I deleted the .vs file in the program solution root and deleted all the bin and debug folders. After that it worked.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint