Java:创建一个键绑定来关闭正在运行的 Prolog 程序
我想用Java创建一个小程序,它在后台运行,检测按键的某种组合(在我的例子中是空格键),并在获得空格键后,将ctrl+c和a发送到a Prolog 控制台命令用于中止将要运行的 Prolog 命令。 这可以做到吗?
预先非常感谢!
I would like to create a little program in Java that runs in the background and that detects a certain combination of pressed keys (in my case the space bar) and that after getting a space bar, sends a ctrl+c and and a to a Prolog console command to abort a prolog command that is going to be running.
Would that be possible to be done?
Thanks a lot in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为在 Java 中,只有当您专注于该 Java 应用程序时,您才能发送输入,因此您唯一的解决方案可能是用 C 或 C++ 来实现,或者甚至使用专门用于自动创建其他输入事件的其他语言应用程序,以简化您的工作。
希望有帮助。
I think in Java you can only send inputs when you have focus in that Java application, so probably your only solution would be to implement that in C or C++ instead, or even to use other languages specialized for the automatic creation of input events to other applications, to simplify your work.
Hope that helps.