So I had this same issue with my mid-2007 Mac Mini. Keyboard would completely cease to function and would only "ding" when hitting any key. The mouse still worked but clicks would not work or no new programs could be launched. While I was on the road working the family would call me frustrated that the computer stopped responding to keyboard strokes.
My workaround: I held the power button down for 3 seconds (not enough to power off) and release the key. This would bring the system back to full functionality. Worked every time. Very strange problem.
My solution: So I put in a call to Apple support and spoke to a really nice girl named Amanda. She had me try a few different things and nothing would resolve this most annoying issue. Amanda had not heard of this issue and she didn't see anything in her notes. But she hung in there with me anyway. So I figured I'd have to wait for an OS software update to resolve this. So as we started to wrap up the call she asked me to try one last thing. She had me boot the Mac in "safe mode". She told me to let the computer completely boot up in safe mode and then reboot the Mac normally. Whatever OS X repairs when in safe mode fixed th issue completely!
This call was well over two weeks (maybe even 3 weeks) ago and I have not experienced the keyboard issue at all again! The problem was completely gone! I am so psyched. I was ready to refresh the system and step back to Snow Leopard, that's how often this keyboard thing was happening.
Thanks to Amanda for hanging in there with me even though we weren't getting anywhere. She had no reports of this bug. I find this interesting since I see alot of talk about it in the Apple forums here and on other sites. She just took a shot and suggested the safe mode thing.
This fix absolutely worked!! Hope this helps someone else out that's experiencing this same issue.
Safe mode link from Amanda: http://support.apple.com/kb/HT1564?viewlocale=en_US
To recap: I have not experienced the keyboard not respoding issue in Mac OS X Lion since rebooting the computer in safe mode. Now on to a couple of other bugs I'm experiencing in Lion. None as serious and annoying as losing your keyboard but annoying nonetheless.