作者nfs258147 (258)
看板Programming
标题[问题] WPF上的Touch Manipulation Event
时间Tue Sep 14 11:03:32 2021
大家好,最近在实作一个触控萤幕的测试,希望能用手指操作外部设备
在Visual Studio 2019 WPF .Net framework上做了一个UI,然後在rectangle 上设定了
一
个Event : ManipulationDelta,触发时显示手指座标变化(我依照MS touch example做
的),开发跟目标设备都是Win10
-我用Windows10 Simulator v16来模拟触控萤幕
-长按右键功能已关闭
手指touched时,座标会变化,但只在手指press down的瞬间触发;关闭UI重启,有时候
会达到我想要的「连续更新座标」,但大部分都只有按下瞬间才更新
刚刚发现...指标在目标区域外面时,可以运作正常,在目标区域内反而只会触发一次,
影片:
https://youtu.be/4rKwJGqD0o0
经过测试,Manipulation event、touchMove等event只会在「进入物件(如我UI中的rect
angle)交界时才会触发。若一开始就在物件内,则不会触发,有什麽方法可以「即使在
物件内,也能触发」?
谢谢
===
自问自答,Manipulation event不适合这案例使用,所以用TouchMove event、并将IsMan
ipulation = false,就可以了!
原始程式码与问题可以同步在这找到,有兴趣可以参考:
https://stackoverflow.com/questions/69171666/uielement-manipulationdelta-only-
triggers-once-on-c-sharp-wpf
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 42.72.107.122 (台湾)
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/Programming/M.1631588614.A.E28.html
※ 编辑: nfs258147 (42.72.107.122 台湾), 09/14/2021 11:43:27
※ 编辑: nfs258147 (114.137.46.179 台湾), 09/14/2021 14:04:46
※ 编辑: nfs258147 (114.137.46.179 台湾), 09/14/2021 14:49:48
※ 编辑: nfs258147 (114.137.46.179 台湾), 09/14/2021 19:05:48
※ 编辑: nfs258147 (114.137.46.179 台湾), 09/14/2021 19:06:29