There are probably better ways to keep an eye on your kid than a raw key dump. Apple Remote Desktop might be an option, there are ways to se it up to observe the iMac's screen discretely and take screen shots. Apple's own documentation describes things in pretty good detail. Obviously you will need admin access to the iMac.
I'm not a parent myself, but i get it. I'm not even sure how to describe the current generation of teenagers, I find myself questioning whether I want kids because of what you read about. I'm sure (I hope) you've tried every channel of communication and taking away his/her personal privacy is a last resort. Good luck.