简体   繁体   English

在Windows 10 Tablet模式下为一个应用程序禁用虚拟键盘

[英]Disable virtual Keyboard in Windows 10 Tablet Mode for one Application

We wrote a C#/WPF Application for Touch Devices and have allready implemented our own virtual keyboard. 我们为Touch Devices编写了一个C#/ WPF应用程序,并且已经实现了我们自己的虚拟键盘。 Since windows 10 anniversary (or earlier) we have problems with devices in "Tablet Mode". 自Windows 10周年(或更早)以来,我们在“平板电脑模式”下遇到设备问题。 The default OSK opens whenever a input field is focused. 只要输入字段被聚焦,就会打开默认的OSK。

So the question is: Is it possible to disable the integrated OSK inside our application? 所以问题是:是否可以在我们的应用程序中禁用集成的OSK? If not, is possible to disable the OSK for JUST OUR APPLICATION via registry or settings? 如果没有,是否可以通过注册表或设置禁用OSK for JUST OUR APPLICATION?

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 : 基于这个线程 ,我设法通过覆盖TextBox OnCreateAutomationPeer方法来禁用自动键盘(TabTip.exe)调用:

class MyTextBox : TextBox
{
    protected override AutomationPeer OnCreateAutomationPeer()
    {
        return new FrameworkElementAutomationPeer(this);
    }
}

As pointed out (and explained) in the comments there is no possibility to disable the OSK just for one application. 正如评论中指出(并解释)的那样,不可能仅为一个应用程序禁用OSK。 We solved the problem by disabling the service "Touch Keyboard and Handwriting Panel". 我们通过禁用“触摸键盘和手写面板”服务解决了这个问题。 Currently it seems to be the only solution, although I'm not fully satisfied. 目前它似乎是唯一的解决方案,虽然我并不完全满意。 It is - at least in our case - a bearable workaround for tablets and convertibles. 它至少在我们的案例中是平板电脑和敞篷车的可承受的解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM