调用Server2012虚拟键盘 [英] Calling Server2012 virutal keyboard
问题描述
亲爱的
在Windows Server 2012下运行的一种应用程序中,我需要在触摸文本框时调用虚拟键盘,并在出现焦点丢失时将其隐藏.
In one of application running under Windows server 2012, I need to call the virual keyboard when a text box is touch and hide it when lost focus occurs.
除此之外,我需要确保虚拟键盘根据所关注的控件正确放置.
In addition to that, I need to be sure the virtual keyboard is properly position based on the control which gets focus on.
基于此,我有2个问题:
based on that I have 2 questions :
1-在控制焦点上有效显示/隐藏此kb的方法是什么?理想情况下,我应该从原始控件中实现一个新的tetx控件,但该控件可以实现VKB处理
1 - What is the way to show/hide this kb efficient on control focus? Ideally I would implement an new tetx control from original control but which implement VKB handling
2- kb定位是否自然取决于要控制的文本框的处理,还是需要以编程方式移动它,这可能会很奇怪?
2- Does the kb positioning is nativly handle depending on text box which gets control or it is needed to move it programmatically which could be wierd ?
感谢帮助
推荐答案
wakefun,
Hi wakefun,
根据您的描述,建议您检查以下项目:
According to your description, I suggest you to check the following projects:
用于WPF应用程序的软件虚拟键盘:为用户提供了一种调用它的方法,然后单击按键将字符插入到应用程序文本字段中.
https://www.codeproject.com/Articles/145579/适用于您的WPF应用程序的软件虚拟键盘
A Software Virtual Keyboard for Your WPF Apps: provide a way for user to invoke it and click on the key-buttons to insert characters into application text fields.
https://www.codeproject.com/Articles/145579/A-Software-Virtual-Keyboard-for-Your-WPF-Apps
WPF触摸屏键盘:WPF触摸屏键盘是可重用的控件和工具包,适用于使用WPF开发触摸屏应用程序的任何人.
http://wpfkb.codeplex.com/
WPF Touch Screen Keyboard :WPF Touch Screen Keyboard is a re-usable control and toolkit for anyone developing a touch screen application in WPF.
http://wpfkb.codeplex.com/
>>在Windows Server 2012下运行的一个应用程序中,我需要在触摸文本框时调用虚拟键盘,并在出现焦点丢失时将其隐藏.
您可以通过启动osk.exe显示虚拟键盘.然后,当TextBox失去焦点时,您可以终止该过程.像这样:
You could display the virtual keyboard by starting the osk.exe. You could then kill the process when the TextBox loses focus. Something like this:
<TextBox GotKeyboardFocus="TextBox_GotKeyboardFocus" LostKeyboardFocus="TextBox_LostKeyboardFocus" />
private void TextBox_GotKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
{
System.Diagnostics.Process.Start("osk.exe"); // display virtual keyboard
}
private void TextBox_LostKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
{
System.Diagnostics.Process p = System.Diagnostics.Process.GetProcessesByName("osk").FirstOrDefault();
if (p != null)
p.Kill();
}
这里的WPF可能只会帮助您开发虚拟键盘的UI,我们不熟悉系统级别的注册步骤.
WPF here may only help you develop the UI of your virtual keyboard, we are not familiar with the system level register step.
最好的问候,
Best Regards,
吕汉楠
这篇关于调用Server2012虚拟键盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!