Lock keyboard in lion
I use KeyboardCleanTool, which ignores all keyboard input. It was created so you can clean the keys without accidental key presses, but obviously would work for your situation too.

It's free!

To unlock, just use the mouse to click the unlock button.