低级热键 kext 可以杀死 WindowServer?

发布于 2024-09-12 10:52:37 字数 169 浏览 1 评论 0原文

我需要制作一个具有非常简单功能的 kext。每当按下组合键时,kext 都会杀死一个恰好是“WindowServer”的进程,

由于问题的性质,它必须是 kext。它必须独立于系统的 UI,因此如果它挂起,我可以按此组合键并重新启动它。

有人可以提供一个起点吗?比如如何制作一个按键处理程序?

I need to make a kext which does a very simple function. Whenever a key combination is pressed the kext should kill a process which happens to be "WindowServer"

It has to be a kext due to the nature of the problem. It has to be independent from system's UI so if it hangs up, I can press this combination and restart it.

Can someone provide a starting point? Like how to make a key handler?

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

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

发布评论

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

评论(1

┼── 2024-09-19 10:52:37

我不相信它需要成为一个 kext。要求您验证管理权限,然后使用它们(如 sudo)运行杀死 WindowServer 的命令行工具的应用程序也应该能够完成这项工作。作为奖励,运行该工具之前的身份验证检查将兼作确认对话框。

I'm not convinced it needs to be a kext. An application that asked you to authenticate for admin powers and then used them (like sudo) to run a command-line tool that killed the WindowServer should do the job just as well. As a bonus, the authentication check prior to running the tool would double as a confirmation dialog.

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