MacBook Pro 15" 2010 keyboard won't work in login screen - Yosemite
Try this...

Start your Mac from the recovery partition. Once it's booted, go to the Utilities menu item and select Terminal. Type in the following command (substituting the OS X startup disk name if different from Macintosh HD)...

rm /Volumes/"Macintosh HD"/Library/Preferences/com.apple.HIToolbox.plist


...and then restart your MacBook.