One of my cats managed to change my French keyboard to Dvorak.
As I had an automatic password requirement, I could not log in again. My password was not recognized.
I managed to log in to another account, which was not admin, and changing the keyboard type in that account. This worked and I accessed my primary account with my regular keyboard. I just had to change the keyboard from Dvorak back to French.
[crarko adds: I haven't tested this one. He doesn't say so in the hint, but I assume that Fast User Switching was the method used to get back to the admin account, since then the chance to type in the password was allowed. I also didn't check this, but I'd guess booting to the Recovery partition should give one the means to change the keyboard type.
Also, watch out for those cats! At least my dogs don't walk on the keyboard.]
Mac OS X Hints
http://hints.macworld.com/article.php?story=20111204134035221