OSX 上的鼠标操作

发布于 2024-10-12 20:33:42 字数 433 浏览 5 评论 0原文

几周前我问了一个类似的问题,但没有得到答案,但这是一个更开放的问题(不过那是假期前几天)。上一个问题是这里

有什么办法可以防止鼠标移动或点击被传递到前台的任何应用程序,或者给人一种它是前台的印象。我对防止鼠标被触控板或魔术板移动特别感兴趣。

我基本上希望用户在魔术板上执行手势,禁用鼠标功能/系统手势,监视/对板上的进一步手势做出反应,并在某个时候重新恢复鼠标功能。我最接近的是不断将鼠标光标扭曲回每个鼠标移动事件激活时的位置,但这会导致鼠标来回闪烁,这非常分散注意力。我已设法全局隐藏光标,但鼠标仍在移动并发生点击,虽然您看不到它,但当下面的应用程序对其做出反应时,这可能会非常分散注意力,令人困惑。

I asked a similar question a few weeks back but it failed to attract an answer but this is a more open query (it was a couple of days before the holidays though). Previous question is here

Is there any way to prevent mouse movement or clicks being passed to whatever app is in the foreground, or give the impression that it is. I'm particularly interested in preventing the mouse being moved by the trackpad or magicpad.

I basically want the user to perform a gesture on the magicpad, disable the mouse functionality/system gestures, monitor/react to further gestures on the pad and at some point re-instate the mouse functionality. The closest I have come to keep warping the mouse cursor back to where it was on activation for each mouse move event, but this causes the mouse to flitter back and forth which is very distracting. I have managed to hide the cursor globally but the mouse is still moving and clicks occurring, which while you can't see it can be very distracting confusing when the app underneath reacts to it.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

紙鸢 2024-10-19 20:33:42

您是否正在操纵自己的应用程序或其他应用程序的事件?

CGAssociateMouseAndMouseCursorPosition() 函数有助于消除鼠标闪烁吗?

CGAssociateMouseAndMouseCursorPosition(false);
...
CGAssociateMouseAndMouseCursorPosition(true);

来自 Apple 的 Quartz Display Services 编程 - 控制鼠标光标

Are you manipulating your own application's events, or other applications?

Would the CGAssociateMouseAndMouseCursorPosition() function be helpful in eliminating the flickering mouse?

CGAssociateMouseAndMouseCursorPosition(false);
...
CGAssociateMouseAndMouseCursorPosition(true);

From Apple's Quartz Display Services Programming - Controlling the Mouse Cursor

小矜持 2024-10-19 20:33:42

格雷厄姆对我之前的问题的评论回答了这个问题

This was answered by Graham's comment on my previous question

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文