将鼠标指针移动到特定位置? [英] Move the mouse pointer to a specific position?

查看:235
本文介绍了将鼠标指针移动到特定位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个HTML5游戏,我试图将鼠标光标放在特定事件的某个控件上,以便在特定方向上移动始终具有相同的结果。这可能吗?

I'm building a HTML5 game and I am trying to put the mouse cursor over a certain control on a specific event so that moving in a specific direction always has the same result. Is this possible?

推荐答案

很棒的问题。这实际上是Javascript浏览器API中缺少的东西。我也和我的团队一起开展WebGL游戏,我们需要这个功能。我在Firefox的bugzilla上打开了一个问题,以便我们可以开始讨论使用API​​来允许鼠标锁定的可能性。这对所有HTML5 / WebGL游戏开发者都很有用。

Great question. This is really something missing from the Javascript browser API. I'm also working on a WebGL game with my team, and we need this feature. I opened an issue on Firefox's bugzilla so that we can start talking about the possibility of having an API to allow for mouse locking. This is going to be useful for all HTML5/WebGL game developers out there.

如果您愿意,请过来发表评论并提出反馈,并提出问题:

If you like, come over and leave a comment with your feedback, and upvote the issue:

https:// bugzilla。 mozilla.org/show_bug.cgi?id=630979

谢谢!

这篇关于将鼠标指针移动到特定位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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