CatNip icon indicating copy to clipboard operation
CatNip copied to clipboard

Any chance of modernization/update?

Open shayneoneill opened this issue 2 years ago • 5 comments

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!)

shayneoneill avatar Aug 03 '22 06:08 shayneoneill

Oh well :(

shayneoneill avatar Nov 17 '22 06:11 shayneoneill

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.

kisonecat avatar Nov 17 '22 11:11 kisonecat

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.

shayneoneill avatar Dec 13 '22 10:12 shayneoneill

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.

kisonecat avatar Mar 23 '23 16:03 kisonecat

Hmm. I think that file might have moved. Doesnt seem to be there anymore.

shayneoneill avatar Mar 27 '23 03:03 shayneoneill