From: Frederick Cheung Date: 2007-12-30T08:53:02+09:00 Subject: Re: Can Ruby be a keylogger on Win/Mac? On 29 Dec 2007, at 22:42, John Joyce wrote: > You're going to have a hell of a time building a keylogger for OS X. > You'll want to look into the input managers. The same thing for > building an Input Method for another language. > With that part of Cocoa, you could definitely monitor input. > Beware though, the docs are dense, and there is big learning curve. > Also, input methods tend to cross the gap between Cocoa and Carbon > (basically between Obj-C and C frameworks) > > You might try an AppleScript layer that intercepts and then passes > the same keystrokes... (System Events) > InputManagers are only loaded into applications that load the cocoa runtime and are sort of on their way out. The lowlevel functionality I would look at would be a CGEventTap (see CGEvent.h) Fred