锁定鼠标位置

发布于 2024-09-06 22:37:32 字数 168 浏览 1 评论 0原文

我不得不再次求助于你。

有没有办法锁定鼠标的 X 和 Y 位置?我的意思是,我想移动鼠标,但我希望将鼠标位置锁定在..比如说屏幕的中心。

顺便说一句,我需要使用 Flash 来完成此操作。

如果有任何解决方法,即使用 JS 或类似的东西,将不胜感激。

谢谢。

I have to resort to you again.

Is there a way to lock the mouse X and Y position?, I mean, I want to move my mouse but I want that the mouse position to be locked on.. let say, the center of the screen.

Btw, I need to do this using Flash.

If there is ANY workaround, i.e, using JS or something like that, would be appreciated.

Thx.

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

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

发布评论

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

评论(2

断桥再见 2024-09-13 22:37:32

使用mouse.hide()隐藏光标,进入全屏,并在任何你想要的地方绘制你自己的“光标”。无论如何,真实光标最远的位置是屏幕边缘,因此用户在玩完游戏后将能够再次找到鼠标。

Use mouse.hide() to hide the cursor, go full screen, and draw your own "cursor" wherever you want it. The farthest the real cursor will go is to the edge of the screen anyway, so the user will be able to find their mouse again when they're done playing.

箹锭⒈辈孓 2024-09-13 22:37:32

您可以做的一件事是隐藏鼠标光标并绘制自己的光标。这可能对你没有帮助,但偶尔我想确保你知道这是可能的。然后您可以在 MouseEvent.MOUSE_MOVE 上跟踪 mouseX 和 mouseY 并根据您的需要更新其位置 - 这有意义吗?

但 Flash 不允许您在系统级别实际捕获和控制用户的鼠标。想象一下滥用的可能性。

One thing you CAN do is hide the mouse cursor and draw your own. That probably doesn't help you, but on the off-chance it does I want to make sure you know it's possible. Then you can keep track of mouseX and mouseY on a MouseEvent.MOUSE_MOVE and update its position according to your needs - does that make sense?

But Flash doesn't let you actually capture and control the user's mouse on a system level. Just imagine the potential for abuse.

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