如何使我的程序通过键盘快捷键执行功能?

发布于 2024-08-22 14:37:27 字数 195 浏览 6 评论 0原文

即使我的 application.exe 不是焦点窗口,我该怎么办?

例如,像 Windows+D 快捷方式...到处都可以使用...

我想要 ALT+1 执行一项功能,ALT+2 执行另一项功能,依此类推...

How can I do it, even if my application.exe is not the focused window ?

For example, like the Windows+D shortcut... Works everywhere...

I want that ALT+1 does a function, ALT+2 does another one, and so on...

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

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

发布评论

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

评论(3

变身佩奇 2024-08-29 14:37:27

你的意思是像这个?

You mean like this?

北风几吹夏 2024-08-29 14:37:27

您需要使用 pyHook

You need to use pyHook.

掀纱窥君容 2024-08-29 14:37:27

我的网站上有一个 pyHook 示例。 http://fadedbluesky.com/2011/using-pyhook-to- block-windows-key/

我最初写这个是为了阻止使用 pygame 编写的游戏中的按键。您应该能够轻松地将其适应其他 Windows 程序。

I have a pyHook example on my site. http://fadedbluesky.com/2011/using-pyhook-to-block-windows-key/

I originally wrote this to block keys in a game written using pygame. You should be able to easily adapt it to other windows programs.

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