Java自动鼠标
我正在制作一个自动播放扫雷的程序。我正在使用鼠标按下功能来单击方块。有没有一种方法可以将焦点集中在扫雷程序上,而无需单击监视器底部的选项卡???谢谢
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用
Robot
(不是拉杰尼:P)。You can simulate mouse click using
Robot
(not rajni :P).你是说Windows任务栏吗?
应用程序在启动时会自动获得焦点。如果用户单击另一个应用程序,则用户还必须通过单击任务栏或使用 Alt-Tab 来请求焦点返回到该应用程序。
如果您的程序没有焦点,那么您就不能仅仅获取焦点,因为用户控制着桌面,而不是您的程序。
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.