处理鼠标和触摸事件 [英] Handling mouse and touch events

查看:51
本文介绍了处理鼠标和触摸事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法像 mouseup 和 mousedown 一样处理 touchup 和 touchdown 事件?如果我用一根手指按下,则窗口想要单击鼠标左键以显示上下文菜单.mousedown 事件不会被触发.是否有事件可以简单地对 touchdown 和 touchup 做出反应,如 mosueup 和 mousedown?在 Win32 中,有按预期工作的指针事件.

is there a way to handle touchup and touchdown events exact the same way like mouseup and mousedown? If I do a press with one finger then windows want to do a left mouse button click to show a contextmenu. The mousedown event is not fired. Are there events to simply react to touchdown and touchup like mosueup and mousedown? In Win32 there were the pointer-events which works as expected.

推荐答案

我找到了!您必须将 Stylus.IsPressAndHoldEnabled 设置为 false 才能在按下手指(不抬起手指)时获取 TouchDown 事件.

I found it! You must set Stylus.IsPressAndHoldEnabled to false to get the TouchDown event when pressing the finger (without lifting it).

这篇关于处理鼠标和触摸事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆