在UWP中以编程方式打开屏幕键盘 [英] Programmatically open On-Screen Keyboard in UWP

查看:139
本文介绍了在UWP中以编程方式打开屏幕键盘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在UWP中是否可以强制其打开屏幕键盘(osk.exe)?

Is it possible in UWP to force it to open the On Screen Keyboard (osk.exe)?

例如,在C#中,可以使用 System.Diagnostics.Process.Start("osk.exe");

For example, in C# it is possible using System.Diagnostics.Process.Start("osk.exe");

在UWP中执行上述操作会导致编译错误,表明没有流程名称空间.

Doing the above in UWP results in compile error saying there is no Process namespace.

我知道在平板电脑模式下,如果我以编程方式专注于TextBox,它将显示OnScreen键盘.

I know that in Tablet mode, if I programmatically focus on a TextBox, it will show up the OnScreen keyboard.

但是在桌面模式下可以吗?

But is it possible when in Desktop mode?

推荐答案

有没有办法让触摸键盘在桌面模式下出现?

Is there a way for touchkeyboard to appear in desktop mode?

键盘交互

取决于设备,当文本字段或其他可编辑文本控件获得焦点时,或者当用户通过通知中心手动启用触摸键盘时,会出现触摸键盘:

Depending on the device, the touch keyboard appears when a text field or other editable text control gets focus, or when the user manually enables it through the Notification Center:

注意,用户可能必须转到设置">系统"中的"<平板电脑模式" 屏幕,然后打开将设备用作平板电脑时使Windows更加易于触摸" 以启用触摸键盘的自动外观.

Note The user might have to go to the Tablet mode screen in Settings > System and turn on "Make Windows more touch-friendly when using your device as a tablet" to enable the automatic appearance of the touch keyboard.

因此,当用户使用触摸输入将输入焦点设置为文本控件时,触摸键盘可以在平板电脑模式下自动出现.但是,在桌面模式和UWP中不会发生这种情况,目前还没有API可以通过编程方式将其打开.

So the touch keyboard can appear automatically in tablet mode when users sets the input focus to a text control by using touch input. However, this won't happen in desktop mode and in UWP, there is no API to open it programmatically by now.

要在桌面模式下显示触摸键盘,我们需要用户通过单击触摸键盘按钮来手动启用它,并且用户可以通过选中任务栏中的显示触摸键盘按钮"来看到此按钮.

To show touch keyboard in desktop mode, we need the user manually enables it by clicking touch keyboard button and users can see this button by checking "Show touch keyboard button" in taskbar.

欢迎您通过 UserVoice Windows反馈中心应用.

这篇关于在UWP中以编程方式打开屏幕键盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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