问题描述
我们为触摸设备编写了C#/WPF应用程序,并且已经实现了自己的虚拟键盘.自Windows 10周年纪念日(或更早)开始,我们在平板电脑模式"下遇到设备问题.只要将输入字段作为焦点,就会打开默认的OSK.
We wrote a C#/WPF Application for Touch Devices and have allready implemented our own virtual keyboard. Since windows 10 anniversary (or earlier) we have problems with devices in "Tablet Mode". The default OSK opens whenever a input field is focused.
所以问题是:是否可以在我们的应用程序中禁用集成的OSK?如果不是,是否可以通过注册表或设置为我们的应用程序禁用OSK?
So the question is: Is it possible to disable the integrated OSK inside our application? If not, is possible to disable the OSK for JUST OUR APPLICATION via registry or settings?
推荐答案
我遇到了完全相同的问题.基于此线程,通过覆盖TextBox
的OnCreateAutomationPeer
方法,我设法禁用了自动键盘(TabTip.exe)调用:
I had exactly the same problem. Based on this thread, I managed to disable automatic keyboard (TabTip.exe) invocation by overriding OnCreateAutomationPeer
method of TextBox
:
class MyTextBox : TextBox
{
protected override AutomationPeer OnCreateAutomationPeer()
{
return new FrameworkElementAutomationPeer(this);
}
}
这篇关于在Windows 10平板电脑模式下为一个应用程序禁用虚拟键盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!