best way to avoid is don't give employers a reason to need to look in on you. if your consistently missing deadlines, racking up complaints about you, you probably should expect your boss will start to look into what it is your really doing.
if your doing well, producing what you are asked or more and not causing any friction leading to complaints, chances are you'll be fine, even if you have a few quiet days where keyloggers might be used