I've had the exact same problem with my PowerBook keyboard -- the trackpad works fine all the time though. I don't have any mice (I only use the trackpad), let alone USB mice.
It goes like this: on returning from screensaver to password check, the keyboard doesn't react, so, being stuck, I hit cancel, as a result the machine goes back to sleep, then I return to password prompt again... repeat 2-4 times... and finally the keyboard reads my input again. It's annoying.