My USB Apple Keyboard stopped working after upgrading to Sierra
Solution 1:
Based on the Apple forums, people have had this similar problem since Yosemite up to Sierra. While there has been no official reason by Apple and many comments have went unanswered on Apple's website.
Here is what people have reported to have work. (whether it makes sense or not, this is in fact what people have confirmed to be working. (same situation identically for some, other keyboards work but not the USB Apple Keyboard.
These are 2 things that have been confirmed to work on iMac 2015 models.
1) Plugging the keyboard into a USB hub, then the hub into the iMac.
2) Plugging the keyboard into any USB extension cable, then the cable into the iMac.
Referrence: https://discussions.apple.com/thread/7501433?tstart=0
Solution 2:
It worked for me when I used a USB extension cable with the Apple wired keyboard. Very strange.
Solution 3:
Yup, after messing around with some serious Mac-Fu involving the scary "csrutil disable" command to roll back protected system files, all to no avail, I plugged my Apple keyboard into the USB extension cable included in the package, and then that directly into my iMac, and my keyboard is working again. Wish I'd come across your thread sooner, or listened to my wife, who suggested the same thing early on. I like to think I can't be blamed too much for responding, "Nah, why would THAT do anything?"