Java自动鼠标

发布于 2024-10-04 17:04:07 字数 81 浏览 0 评论 0原文

我正在制作一个自动播放扫雷的程序。我正在使用鼠标按下功能来单击方块。有没有一种方法可以将焦点集中在扫雷程序上,而无需单击监视器底部的选项卡???谢谢

I am making a program which plays minesweeper automaticaly. I am using the mouse press function to click the squares. Is there a way of giving focus to the minesweeper program without clicking on the tab at the bottom of the monitor??? Thanks

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

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

发布评论

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

评论(2

骑趴 2024-10-11 17:04:07

您可以使用 Robot(不是拉杰尼:P)。

You can simulate mouse click using Robot (not rajni :P).

我的奇迹 2024-10-11 17:04:07

有没有一种方法可以将焦点集中到扫雷程序上,而无需单击监视器底部的选项卡?

你是说Windows任务栏吗?

应用程序在启动时会自动获得焦点。如果用户单击另一个应用程序,则用户还必须通过单击任务栏或使用 Alt-Tab 来请求焦点返回到该应用程序。

如果您的程序没有焦点,那么您就不能仅仅获取焦点,因为用户控制着桌面,而不是您的程序。

Is there a way of giving focus to the minesweeper program without clicking on the tab at the bottom of the monitor?

You mean the Windows task bar?

An application automatically gets focus when it is started. If the user clicks on another applcation then the user must also request focus to go back to the application by clicking on the task bar or by using Alt-Tab.

If your program doesn't have focus then you can't just grab focus, because the user is in control of the desktop and not your program.

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