On my keyborad the ESC key is all the way up in the upper left corner, primarily to keep idiots like me from doing exactly what you experienced, Jim. Maybe you need to move the key to an out of the way location.
I find that other unfortunate key combinations have the same effect. Unfortunately, I can't duplicate them. They seem to happen randomly while I am using more than one finger to type.
Oops, I just did it again and deleted this entire message. Oh well, it was the thought that counts.