Disable virtual Keyboard in Windows 10 Tablet Mode for one Application

こ雲淡風輕ζ 提交于 2019-11-30 19:58:27

问题


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.

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?


回答1:


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);
    }
}



回答2:


As pointed out (and explained) in the comments there is no possibility to disable the OSK just for one application. 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.



来源:https://stackoverflow.com/questions/40845538/disable-virtual-keyboard-in-windows-10-tablet-mode-for-one-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!