WPF停靠的Windows 10触摸式开放式键盘 [英] Open Windows 10 touch keyboard docked in WPF

查看:166
本文介绍了WPF停靠的Windows 10触摸式开放式键盘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们开始在Windows 8中创建WPF触摸应用程序,并且最近迁移到Windows10.我们实现的一项功能是在TextBox获得焦点时打开Windows键盘.在Windows 8中,可以通过设置注册表设置EdgeTargetDockedState并启动TabTip进程将键盘停靠在底部:

We started creating a WPF touch application in Windows 8 and recently migrated to Windows 10. One feature we implemented is opening the Windows Keyboard when a TextBox receives focus. In Windows 8, it was possible to dock the keyboard to the bottom by setting the registry setting EdgeTargetDockedState and starting the TabTip process:

     string path =  @"C:\Program Files\Common Files\Microsoft Shared\ink\TabTip.exe";
     var info = new ProcessStartInfo(path);
     info.WindowStyle = ProcessWindowStyle.Maximized;
     var p = new Process();
     p.StartInfo = info;
     p.Start();

但是,Windows 10键盘似乎没有与Windows 8相同的停靠行为.键盘现在覆盖了任何最大化的窗口,该窗口隐藏了任何应用程序的底部.仅调整未最大化的窗口的大小以适合剩余空间.

The Windows 10 keyboard however doesn't seem to have the same dock behavior as in Windows 8. The keyboard now overlays any maximized window which hides the bottom part of any application. Only not-maximized windows are resized to fit the remaining space.

我检查了以下链接,但没有找到解决方法:

I've checked the following links, but found no solution:

  • https://superuser.com/questions/951841/windows-10-touch-keyboard-doesnt-dock-or-maximize-at-the-bottom-of-the-screen
  • http://answers.microsoft.com/en-us/windows/forum/windows_10-desktop/windows-10-touch-keyboard-doesnt-dock/3c253400-568f-4e89-a253-0d7a747b5b63

Windows 10键盘是否可以通过编程方式固定在一个最大化的窗口中?

Can the Windows 10 keyboard be docked programmatically for a maximized window?

推荐答案

我开源了我的项目,以使WPF应用程序中与TabTip集成有关的所有事情自动化.

I open-sourced my project to automate everything concerning TabTip integration in WPF app.

您可以在 nuget 上获取它,然后,您只需做一个简单的配置即可在您的应用启动逻辑中:

You can get it on nuget, and after that all you need is a simple config in your apps startup logic:

TabTipAutomation.BindTo<TextBox>();

您可以将TabTip自动化逻辑绑定到任何UIElement.当任何此类元素获得焦点时,虚拟键盘将打开,而当元素失去焦点时,虚拟键盘将关闭.不仅如此,TabTipAutomation还会将UIElement(或Window)移到视图中,以便TabTip不会阻止聚焦的元素.

You can bind TabTip automation logic to any UIElement. Virtual Keyboard will open when any such element will get focus, and it will close when element will lose focus. Not only that, but TabTipAutomation will move UIElement (or Window) into view, so that TabTip will not block focused element.

有关更多信息,请参见项目站点.

For more info refer to the project site.

要澄清:如果您将使用此软件包,TabTip不会停靠,但您的UI会在视图中,我想这就是您想要实现的目标.

To clarify: If you will be using this package TabTip will not be docked, but your UI will be in view, which i guess is what you wanted to achieve.

这篇关于WPF停靠的Windows 10触摸式开放式键盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆