PaperJS如何防止多个按钮取消鼠标上的拖放事件 /允许纸张仅使用左键

发布于 2025-02-08 19:27:35 字数 934 浏览 2 评论 0 原文

如果您:

  • Mousedown左键↓
  • Mousedown右键按钮↓
  • MouseUp右键右键↑

拖动事件被 MouseUp右键,我不希望这种情况发生。
(仅希望在 MouseUp左键上发生这种情况,因为该事件是由 MLB 。)

  • 我尝试过 > dextrest -default(),纸张上的stoppropagation() 窗口事件。
  • 我已经尝试在MouseUp tool.emit上发射Mousedown/Mousedrag(“ Mousedown”,tool.onmousedown); 不确定我是否对此做错了什么,但是它运行一次Mousedown函数停止,我认为它不会将事件数据保留在第一个Mousedown中。

有什么方法可以防止这种情况,甚至可以防止纸张在需要时完全访问正确的按钮?

我知道这已经有一段时间了: https://github.com /paperjs/paper.js/issues/1355
然而,有一个修复程序可以访问1,2,3 ..按钮(事件为任何).event.button
没有修复程序可以防止将拖动设置为> false

PS感谢任何帮助!

If you:

  • mousedown left button ↓
  • mousedown right button ↓
  • mouseup right button ↑

The drag event gets canceled by mouseup right button , I don't want that to happen.
(only want that to happen on mouseup left button , because the event was started by mlb.)

  • I've tried preventDefault(), stopPropagation() on both paper and
    window event.
  • I've tried emitting mousedown/mousedrag on mouseup tool.emit("mousedown", tool.onMouseDown); not sure if I'm doing something wrong with it, but it runs the mousedown function once and stops, and I don't think it keeps event data from the first mousedown.

Is there any way to prevent this, maybe even preventing Paperjs from accessing the right button entirely if needed?

I know this has been kind and issue for a while now: https://github.com/paperjs/paper.js/issues/1355
yet there is a fix for accessing 1,2,3.. buttons (event as any).event.button,
there is no fix for preventing the dragging to be set to false.

P.S Appreciate for any help!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文