有没有任何方法可以接受键盘输入而无需将窗口放在焦点中
我正在使用Python中的Pygame模块为我的YouTube/个人使用制作显示应用程序。当我将PyGame窗口重点介绍时,我可以从键盘中获取输入,但是当我使用另一个应用程序时,我可以从键盘上获取输入。 是否有:
- 在Pygame中不关注的时候接受输入的一种方法?
- 我可以导入其他一些模块以在未关注时接收输入?
I am using the pygame module in python to make display applications for my youtube/personal use. I can get input from my keyboard when I have the Pygame window in focus, but not when I am using another application.
Is there:
- Some way to accept inputs while unfocused in pygame?
- Some other module I can import to receive inputs while unfocused?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
想到的一个模块是键盘,尽管我会查看其从读书中的已知限制,从它的 github 查看它是否真的适合您的用例。
One module that comes to mind is keyboard, although I would check out the known limitations on its README from its github to see if it's really right for your use case.