是否可以在c#中显示,隐藏和操作Windows 8屏幕键盘? [英] Is it possible in c# to show, hide, and manipulate the Windows 8 on-screen keyboard?

查看:191
本文介绍了是否可以在c#中显示,隐藏和操作Windows 8屏幕键盘?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作一个WPF应用程序,该应用程序将在没有硬件键盘的自助服务终端上使用.当前,我们使用的是第三方屏幕键盘,但Windows 8版本要好得多,我们正在考虑切换到该键盘.

I am making a WPF application that is to be used on a kiosk with no hardware keyboard. Currently we are using a third party on-screen keyboard, but the Windows 8 version is a lot better and we are thinking of switching to it.

所以我的问题很简单,就是是否可以使用c#显示/隐藏它以及显示仅数字版本.

So my question is simply if it is possible to show/hide it as well as show a numeric only version using c#.

谢谢! 大卫

推荐答案

来自

没有直接方法以编程方式控制触摸键盘. 要求用户设置焦点而不是程序是一个 精心设计的决策,以防止UI流失.

There is no direct way to control the touch keyboard programmatically. Requiring the user to set the focus rather than the program is a deliberate design decision to prevent UI churn.

请参见输入托管管理器和触摸键盘欲获得更多信息 关于如何运作以及为什么运作的信息. 用户驱动的调用部分那 该文档说明了您要询问的特定行为.

See Input Hosting Manager and the Touch Keyboard for more information on how and why this works. The User-driven invocation section of that document explains the specific behavior you are asking about.

但是,一旦用户触摸了输入控件,软键盘将自动显示(无需额外的编码).

But, once the user touches an input control, the soft keyboard will automatically be displayed (with no extra coding needed).

最后,要解决仅数字版本的键盘上的问题,您可以使用此处枚举不同的输入范围,但其中之一是数字".

Finally, to address your question on a numeric-only version of a keyboard, you may propose a different keyboard layout using InputScope on a TextBox. The different input scopes are enumerated here, but one of them is "Number".

这篇关于是否可以在c#中显示,隐藏和操作Windows 8屏幕键盘?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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