在OSX中截取键盘输入 [英] Intercept keyboard input in OSX

查看:123
本文介绍了在OSX中截取键盘输入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图编写一个应用程序,防止某些关键信号传播到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.

推荐答案

您可能想查看 Quartz Event Taps 。请注意,您的进程需要使用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.

另请参见 http://stackoverflow.com/questions/1776567/osx-quartz-event-taps-event -types-and-how-to-edit-events

这篇关于在OSX中截取键盘输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆