低级热键 kext 可以杀死 WindowServer?
我需要制作一个具有非常简单功能的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不相信它需要成为一个 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.