Here’s a great idea from lifehacker.com. If your cat(s) like to flop down on your keyboard ( of course while you’re working), try setting out a decoy keyboard. The cat can paw at it, sleep on it, or press keys – no data will disappear into cyberspace.
Definitely worth trying. Let me know in the “Comments” section if it works!
I think it is your attention the cat wants, not the keyboard.