I too have been having these problems with Firefox 2 for the Mac. If I open Safari and start using it, then switch back to Firefox, sometimes that will allow me to start using the keyboard again inside of Firefox. Strange. It's so annoying I'm considering giving up Firefox as my primary browser.
I have suffered this bug, of the keyboard losing focus, ever since I bought a Fujitsu S6240 Lifebook notebook. However I hadn't realised that it was connected with Firefox; I had the problem whenever I logged into my bank's Internet site, and several other areas also, however now you mention it... Quite honestly the latest Internet Explorer 7 offering seems to be pretty good, so I might regress. I've always liked Firefox but I won't stick with them if they can't get their act together.