Suddenly Apple Wired Keyboard not working
This is what solved it for me:


  Eventually I found this thread on the Apple website, and followed the rather bizarre advice of adding a USB extension cable between the keyboard and the Mac (luckily the keyboard comes packaged with one). Bingo! Keyboard fine, mouse plugged into it also fine.


http://www.zigpress.com/2014/12/30/has-your-apple-mac-external-usb-keyboard-stopped-working/