问题描述
我试图编写一个应用程序,防止某些关键信号传播到OSX操作系统之外。为了澄清,我想让它几乎看起来,用户,他们推在键盘上的钥匙被打破了。所以,相关的字母将不会出现在textarea,该键不会激活另一个应用程序中的功能等。任何想法?提前感谢。
I'm trying to write an application that prevents certain key signals from propagating beyond the OS in OSX. To clarify, I want to make it so that it almost seems to the user that the key they are pushing on their keyboard is broken. So, the associated letter won't show up in a textarea, the key won't activate a function in another application, etc. Any ideas? Thanks in advance.
推荐答案
您可能想查看。请注意,您的进程需要使用root权限运行,以便在系统级别拦截事件。
You probably want to look into Quartz Event Taps. Note that your process will need to be running with "root" privileges to intercept events at the system level.
另请参见
这篇关于在OSX中截取键盘输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!