I got the same problem,sometimes i have to use a external keyboard for my powerbook g4 laptop.
My keyboard problem disappeared, but I have no idea how or why. I did reinstall the OS, and tried a few other workarounds, but still had one or two recurrences afterwards. I have used my PB a lot less in the last few months, so it may have to do with the fact that it's not running 24:7. Odd.