有没有任何方法可以接受键盘输入而无需将窗口放在焦点中

发布于 2025-01-21 19:27:42 字数 190 浏览 3 评论 0原文

我正在使用Python中的Pygame模块为我的YouTube/个人使用制作显示应用程序。当我将PyGame窗口重点介绍时,我可以从键盘中获取输入,但是当我使用另一个应用程序时,我可以从键盘上获取输入。 是否有:

  1. 在Pygame中不关注的时候接受输入的一种方法?
  2. 我可以导入其他一些模块以在未关注时接收输入?

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:

  1. Some way to accept inputs while unfocused in pygame?
  2. Some other module I can import to receive inputs while unfocused?

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

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

发布评论

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

评论(1

白馒头 2025-01-28 19:27:42

想到的一个模块是键盘,尽管我会查看其从读书中的已知限制,从它的 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.

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