I had the same issue (though experienced differently).
I installed Yosemite on a 2010 iMac and used with apple usb keyboard. A week or more later (just now) I've updated several settings including but not limited to: Security setting, iCloud settings-and logging in to some services thereof, etc.
The iMac went to sleep, I returned and unplugged the wired keyboard, plugged in my iPad and then the keyboard no longer functioned (thankfully I had a bluetooth keyboard setup also and could use it). I read this thread and tried all of the following:
1. Plugging keyboard into 2012 MacBook Pro (it worked there, did not work when returned to iMac)
2. tested all USB ports on iMac with usb flash drives (all worked)
3. plugged flash drive into keyboard (no result)
4. Plugged iPhone into keyboard (no result)
5. Plugged iPad into keyboard (no result)
6. Found keyboard extension, plugged it in with keyboard (FINALLY!!) (please note that iPad was still plugged into the keyboard via lightning cable at time of extension plugging-in)
7. briefly gave thanks that I chose NOT to discard the otherwise useless usb extension that came with this keyboard.
As a side note, I noticed earlier that even though my Bluetooth keyboard was connected and operational, it did NOT come up as discovered in the "setup bluetooth keyboard" pane of the "keyboard" section of system preferences even though I could connect and disconnect it from the iMac and see the keyboard icon with the words: "disconnected" and "connected"
It does, however appear in the "Bluetooth" section of system preferences. (not sure that any of that was related to the wired keyboard issues, but hey, if it helps someone else.
Thanks for the help.