开发者

Intercept keyboard input in OSX

开发者 https://www.devze.com 2023-01-18 06:37 出处:网络
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 us开发者_StackOverflow社区er th

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 us开发者_StackOverflow社区er 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.


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.

See also OSX Quartz Event Taps: event types and how to edit events

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号