禁用鼠标提升

禁用鼠标提升

问题描述:

是否可以通过任何方式禁用代码中的鼠标提升功能,从而防止Windows将触摸事件解释为鼠标事件?

Is there any way to disable mouse promotion from code, that is preventing windows to interpret touch events as mouse events?

我在WPF应用程序中捕获了触摸事件,并且我不希望这些交互影响鼠标指针的可见性和位置.

I capture touch events in my WPF application, and I don't want these interactions to effect mouse pointer visibility and position.

有一个

There is a TouchFrameEventArgs.SuspendMousePromotionUntilTouchUp Method that seems to be doing exactly that. Unfortunately it's available only for Silverlight and Windows Phone.

此外,您可以使用一些系统设置来禁用双击和右键单击促销,但不能整体上禁用鼠标促销.

In addition there are some system settings you can use to disable double click and right click promotion, but nothing to disable mouse promotion as a whole.

特定于Windows 8的解决方案或低级解决方案也将有所帮助.

A Windows 8 specific solution or a low level solution would also help.

似乎没有任何这样的选项(至少在Windows 8.1和.NET 4.5之前).

There doesn't seem to be any such option (at least up to Windows 8.1 and .NET 4.5).

禁用鼠标提升的唯一方法是完全禁用手指输入,方法是从系统控制面板内(打开控制面板,打开笔和触摸",选择触摸"选项卡,禁用使用手指作为输入"设备")或通过注册表(HKLM \ Software \ Microsoft \ Wisp \ Touch,TouchGate = 0 =禁用触摸)

The only way to disable mouse promotion is to disable finger input completely, either from within the system control panel (open control panel, open "Pen and Touch", select "Touch" tab, disbale "Use your finger as an input device") or via Registry (HKLM\Software\Microsoft\Wisp\Touch, TouchGate = 0 =disable touch)

然后,您仍然可以使用以下(讨厌的)替代方法之一处理触摸输入:

Then you can still process touch input using one of the following (nasty) alternatives:

  • Write your own WinUSB driver for your touch device
  • Get raw touch input data using the RawInput API
  • Find a 3rd party USB driver for your device (e.g. UPDD TouchBase)

最后,您可以使用自定义路由事件将收集到的触摸数据注入到您的应用程序中或使用触摸注入.

Finally, you can inject the collected touch data into your application using custom routed events or using touch injection.

在任何情况下,您当然都会对系统上的任何其他应用程序失去触摸支持,因此,该解决方案通常对您没有太大帮助.

In any case you will, of course, loose touch support for any other application on your system, so this solution will in general not be too helpfull to you.