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

查看:27
本文介绍了是否可以在 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).

最后,为了解决您对纯数字键盘的问题,您可以使用 InputScope.这里列举了不同的输入范围,但其中之一是数字".

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天全站免登陆