If you have a computer and a cat, you’ll likely see your cat getting in the way of your computer. The main theory on why cats seem to love keyboards so much is because they see their owners touching them all the time. So cats naturally assume if you’re going to touch a keyboard all the time, they might as well lay across it so you’ll touch them instead.
One solution is to provide a bed near your computer for your cat to lay on. Then every time your cat lays in that spot, shower it with affection so it will learn to stay in its bed and no drape itself across your keyboard. This will also keep you from working on your computer, which is what cats really want to achieve.