zoukankan      html  css  js  c++  java
  • 2019-11-9-win10-支持默认把触摸提升-Pointer-消息

    title author date CreateTime categories
    win10 支持默认把触摸提升 Pointer 消息
    lindexi
    2019-11-09 15:32:31 +0800
    2018-2-13 17:23:3 +0800
    WPF 触摸

    在 WPF 经常需要重写一套触摸事件,没有UWP的Pointer那么好用。 如果一直都觉得 WPF 的触摸做的不好,或想解决 WPF 的触摸问题,但是没有方法,那么请看下面。

    只要新建框架为 .net 4.7 以上,运行的系统是Windows 10 Creators Update 就可以。

    打开新建的工程,设置框架。

    然后打开 App.config,添加支持把触摸和笔到鼠标

         <runtime>
            <AppContextSwitchOverrides value="Switch.System.Windows.Input.Stylus.EnablePointerSupport=true"/>
        </runtime>

    需要知道,这个特性不支持实时的笔迹。

    因为笔迹需要运行在UI线程,会导致比较差的性能。

    开启了这个属性就可以使用 Pointer 消息。

    因为有小伙伴说使用了我上面代码无法打开 Pointer 消息,我看了他代码,发现他写错了,所以我把全部 App.config 代码写出来。

    <?xml version="1.0" encoding="utf-8"?>
    
    <configuration>
      <startup>
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7" />
      </startup>
      <runtime>
        <AppContextSwitchOverrides value="Switch.System.Windows.Input.Stylus.EnablePointerSupport=true" />
      </runtime>
    </configuration>

    参见:Mitigation: Pointer-based Touch and Stylus Support

  • 相关阅读:
    关于带权并查集
    Connections in Galaxy War ZOJ
    Supermarket POJ
    并查集判树 poj 1308
    最长异或值路径【字典树应用】
    最大异或对
    trie字典树【模板题】
    UVA536 二叉树重建 Tree Recovery
    UVA1584环状序列 Circular Sequence
    【CodeForces 622F】The Sum of the k-th Powers
  • 原文地址:https://www.cnblogs.com/lindexi/p/12085809.html
Copyright © 2011-2022 走看看