如何关闭应用程序、窗口或控件级别的所有触摸输入?
使用 c# 开发 wpf 应用程序,如果在 Windows 7 中控制面板中启用了触摸功能,则默认情况下用户可以用手指在 InkCanvas
上“书写”。我想禁用它并仅强制使用手写笔输入。
如果可能的话,我想知道如何以多种方式执行此操作:首先禁用 InkCanvas
上的触摸,其次为特定窗口禁用它,第三为整个应用程序禁用它。第四个好处是知道如何在系统范围内打开或关闭触摸。
我尝试过 UnregisterTouchWindow,并且尝试将 InkCanvas 的 Stylus.SetIsTouchFeedbackEnabled 设置为 false,但都不起作用。
Using c# for a wpf application, if in Windows 7 touch is enabled in the control panel, a user by default can 'write' on an InkCanvas
with a finger. I want to disable that and force stylus input only.
I'd like to know how to do it more than one way if possible: first by disabling touch on the InkCanvas
, second by disabling it for a particular window, and third by disabling it for the entire application. A bonus fourth would be knowing how to turn touch on or off system-wide.
I have tried UnregisterTouchWindow
, and I have tried setting Stylus.SetIsTouchFeedbackEnabled
to false for the InkCanvas
, but neither has worked.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
进一步的挖掘帮助我将以下内容组合在一起,作为在系统范围内打开/关闭触摸的方法。如果有人知道如何以其他三种方式中的任何一种来完成此任务,我仍然会很感激这些答案。
基本步骤是检查当前注册表状态,必要时进行更改(然后刷新系统以识别更改),并记下初始状态,以便在程序退出时根据需要进行恢复。
感谢两个上的海报 教育链接。
Further digging helped me put together the following as a way to toggle touch on/off system-wide. If anyone knows how to accomplish this in any of the other 3 ways, I'd still appreciate those answers.
The basic steps are to check the current registry status, change it if necessary (and then refresh the system to recognize the change), and make note of the initial state to restore if needed on program exit.
Thanks to the posters at these two links for the education.