For the keyboard hoggers out there, state training is actually super easy with food motivated cats, and relatively easy with attention motivated cats. Basically, it's super easy to just train them to sit in your lap instead.
You'll need a container of treats and an interval timer such as a pomodoro or workout interval timer (lots of apps out there).
Basically set the time interval to like 5-10 seconds to start, and pull the cat into your lap at the computer. Every time it beeps and the cat is still in your lap, give them a treat. After the first set or so, do not provide a treat if the cat reaches for the desk at all during the interval.
After about 2-3 sets, lengthen the interval to 10-15, then 20-30 seconds, then keep lengthening the interval by about 1.5x every 2-3 sets. It shouldn't take long to get up to 3-5 minutes, at which point the cat should be solidly state trained.
If they were attention motivated enough to seek your company by stepping on the keyboard while you work, having your non dominant hand in your lap petting them will likely be sufficient ongoing reinforcement.
For non food motivated cats, replace the treat dispensation with a few seconds of petting and praise in the specific way they like most.