WPF自动打开平板电脑键盘 [英] WPF Auto Opening Tablet Keyboard

查看:114
本文介绍了WPF自动打开平板电脑键盘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个全屏且在平板电脑上的WPF应用程序,因此不一定要连接键盘.当输入框处于焦点状态时,我需要Windows键盘显示.我该怎么做?假设Windows的最低版本 是Windows 10周年纪念版.

I have a WPF application that is fullscreen and on a tablet, so it doesn't necessarily have a keyboard attached. I need the Windows keyboard to display when an input box is focused. How can I accomplish this? Let's say that the minimum version of windows is windows 10 anniversary edition.

我已经尝试过输入设置并启用当不在时显示触摸键盘...".除非有人按下键盘上的X按钮,否则这将非常有用.在那之后,它不再显示.更糟糕的是该应用程序是全屏的,所以 用户无法关闭应用程序或重新打开应用程序.

I have already tried going to typing settings and enabling "Show the touch keyboard when not in...". This works great until someone hits the X button on the keyboard. After that, it no longer shows up. What's worse is the app is full screen so the user has no way of closing the app or re-opening the app.

推荐答案

1.根据 至少需要.NET Framework 4.6.1 . 每当任何文本字段获得焦点时,软键盘支持都会自动触发.

1. According to the What's new in the .NET Framework 4.6.2 , Soft keyboard support at least need .NET Framework 4.6.1. Soft Keyboard support will automatically triggered every time any text field gets focus.

您需要Windows 10周年纪念版,并且您需要使OS处于Tablet模式,或者可以选择在未处于Tablet模式下时显示键盘.在满足这些条件的情况下,当控件通过 触摸或手写笔.

You need Windows 10 Anniversary Edition and you need to have the OS in Tablet Mode or have the option to show the keyboard when not in tablet mode turned on. With those conditions met, WPF will automatically show the keyboard when a control is focused via touch or stylus.

如何在与WPF文本框进行触摸交互时显示触摸键盘

How to show touch keyboard on touch interaction with WPF TextBoxes

http://blog.mzikmund.com/2015/09/如何显示触摸键盘与wpf文本框的触摸互动/

2.如果软键盘没有弹出,则可以通过编程方式打开  osk.exe .

2. If the Soft Keyboard doesn't popup, you could open the osk.exe  programmatically.

private void TextBox_GotFocus(object sender, RoutedEventArgs e)
{
    Process.Start("osk.exe");
}

3.您还可以考虑 TabTip.exe软键盘. 

3. You can also consider the TabTip.exe soft Keyboard . 

为WPF桌面应用程序添加触摸键盘支持

Adding Touch Keyboard Support to a WPF Desktop Application

http://mheironimus.blogspot.sg/2015/05 /adding-touch-keyboard-support-to-wpf.html

http://mheironimus.blogspot.sg/2015/05/adding-touch-keyboard-support-to-wpf.html

4.您还可以使用一些第三方来源,例如:

WPF触摸屏键盘

https://wpfkb.codeplex.com/

https://wpfkb.codeplex.com/

希望这对您有帮助.

注意:此回复包含对第三方万维网站点的引用. Microsoft为方便您而提供此信息. Microsoft不控制这些站点,也没有测试在这些站点上找到的任何软件或信息;所以, Microsoft无法对在此找到的任何软件或信息的质量,安全性或适用性做出任何陈述.使用Internet上发现的任何软件都存在固有的危险,Microsoft提醒您确保自己 在从Internet检索任何软件之前,应完全了解风险.

Note: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; Therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

最好的问候,

鲍勃


这篇关于WPF自动打开平板电脑键盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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