CatNip
CatNip copied to clipboard
Any chance of modernization/update?
I'm back in the "has a cat" game, and the little guy sure does love my keyboard (I guess they all do).
This codes pretty old and crufty at this point, but the concepts rock solid. Any chance of a modernization?
(Oh and maybe you can grab a few bucks by chucking it on the app store!)
Oh well :(
Ah! I should have written back... I am sorry.
I'm not on Mac OS anymore, so I'm not super familiar with how much the landscape has changed for this kind of software on the Mac. It's somewhat dangerous software to write, since CatNip needs to intercept /all/ keyboard input, so I understand why Apple has made this more difficult. But I imagine one could modify the daemon presented in
https://www.kuniga.me/blog/2021/11/16/a-simple-key-logger.html
to make progress.
Yeah I think it comes down to getting the accessibility permissions to track user input. Its still available but it requires explicit permission. Not impossible but a bit of extra work.
I think the issue is more that the old Carbon APIs are gone so its Cocoa now. I'm tempted to have a crack at reimplementing this myself, but like a lot of things ..... time...... Might study the code and figure out how the 'cat detection' worked. I seem to remember this thing being very effective against my old kitty a decade ago.
The cat detection is not too bad.
https://github.com/kisonecat/CatNip/blob/master/Daemon/main.m#L413-L454 is the place where this happens. Basically if neighboring keys are pressed down slowly, then cat-like typing is triggered. What helps is that /System/Library/Components/KeyboardViewer.component/Contents/SharedSupport/KeyboardViewerServer.app/Contents/Resources/KeyboardViewerServer.rsrc
can be accessed to get physical locations of the keys.
Hmm. I think that file might have moved. Doesnt seem to be there anymore.