是否可以恢复 Mac OS 启动时完成的键盘输入?
我想知道是否有可能弄清楚用户在 Mac 操作系统启动时按下了哪些键?
任何方式都可以。据我了解,没有简单的方法可以简单地挂钩应用程序/脚本来开始工作并与操作系统同时捕获击键。但也许有一种方法可以对此进行某种逆向工程?也许查看特定的日志文件或类似的东西?
任何结果都可以。基本上我感兴趣的是找出用户在操作系统启动期间按下/按住的键。它可能是字符串、字符代码或十六进制,并不重要。
更新:根据 Pekka 的建议,我找到了一个可以完成这项工作的内核扩展。在这个后续问题之后,希望它能够做到这一点 - 为什么这个键盘拦截内核扩展不起作用? 已得到解答。 :)
I wonder if it is possible to figure out what keys user was pressing while his Mac OS was starting up?
Any way will do. As far as I understand it there is no easy way to simply hook an app/script to start working and capturing keystrokes simultaneously along with the OS. But maybe there is a way to some kind of reverse engineer this? Maybe looking into a specific log file or something like that?
Any results will do. Basically what I'm interested in is in finding out, which key the user pressed/held during the OS startup. It may be string, a character code or a hex, doesn't really matter.
UPDATE: guided by Pekka's advice I've found a kernel extension that should do the job. And it, hopefully, will do it, after this follow-up question - Why this keyboard intercepting kernel extension doesn’t work? is answered. :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我不是操作系统专家,但我认为非常非常困难。我不认为这样的东西会自动记录在任何地方。
我想您必须查看系统中处理启动的部分键 可以以某种方式访问,并且可以扩展以调用您定义的命令。
第二个想到的最好的事情是让您编写某种自定义设备驱动程序或启动脚本,在启动时加载并侦听按键事件。
I'm no OS guru, but I think very, very, very hardly. I don't suppose stuff like this is automatically recorded anywhere.
I guess you would have to look whether the part of the system that handles the startup keys is somehow accessible, and can be extended to invoke a command defined by you.
The second best thing that comes to mind is for you to write some sort of custom device driver or startup script that gets loaded at startup, and listens to keypress events.
如何解决这个问题完全取决于 启动过程您要检查密钥。
How to approach this depends completely on what point in the boot process you want to check for keys.
它不仅没有在任何地方记录,而且在启动过程中很长一段时间都没有键盘驱动程序。因此,从软件的角度来看,在这段时间内键盘根本不存在。
It's not just not recorded anywhere, for quite a while during startup there is no keyboard driver. So from the point of view of software, during that interval the keyboard simply doesn't exist.