I have a late 2013 iMac running macOS Sierra. I use a Coolermaster Storm Quickfire TK mechanical keyboard with this computer. It has worked perfectly until last night.
I was writing some code in the Atom text editor (using the Vim plugin, of course), and suddenly the "Your keyboard cannot be identified and will not be usable..." box popped up. I went through the steps of pressing the keys it wanted me to press, selecting my keyboard layout, then clicking Done. After that, my keyboard started acting up. I opened Keyboard Viewer so I could investigate.
The space bar, backspace, and esc keys do not even register. When I type 'e', macOS thinks I'm typing 'e' and space bar at the same time. When I type 'd', it thinks I'm typing 'd' and tab. When I type 'c', it sees 'c' and the left arrow. Once again, I'm just typing the one letter key, but both keys light up in Keyboard Viewer. There are several more keys that do the same thing. When I'm not pressing any keys on the keyboard, no modifier keys are registering in Keyboard Viewer.
I plugged a spare keyboard into my mac, and it works fine. It is also a third-party, non-Apple keyboard. I plugged the problematic keyboard into a Windows computer, and it worked fine there. I tested all the keys that were giving me trouble on my mac.
I've googled my problem, but I haven't found any help at all. Any support articles are about Apple keyboards and they do not cover the problem I am having. I have already tried deleting any user preferences files related to the keyboard, and I have confirmed that the Mouse Keys setting is turned off.
I'm using the ANSI layout, and the only Input Source is U.S.
I would really like to continue using this keyboard as I paid good money for it and I really like the sound and feel of the mechanical switches. Obviously, the keyboard is working, and the problem appears to be with how macOS is interpreting the input. I'm hoping someone will recognize the symptoms I am having and can tell me that I accidentally turned on some obscure setting or something like that. Any help is appreciated, but I will say up front, I'm not buying an official Apple keyboard as an easy fix.