处理鼠标和触摸事件

编程入门 行业动态 更新时间:2024-10-28 10:25:28
本文介绍了处理鼠标和触摸事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

有没有办法像 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屋!

更多推荐

[db:关键词]

本文发布于:2023-04-30 02:15:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1388258.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:鼠标   事件

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!