2014 iMac suddenly not working with wired keyboard
Okay, this has me boggled. Had the iMac for a year, no problems. Used the same wired keyboard, admittedly Windows-style, for that year, no problems. Moved to a new place last night and set up the computer and the keyboard even worked then to allow me to punch in the password and new Wifi info, all that. Now this morning, I go to plug in the login password. No response. wired mouse is working perfectly. I plug the mouse into every port, works instantly. I try plugging the keyboard into every work, no go at all. I then plug the keyboard in my separate MacBook and it works like a charm. So the keyboard is fine, the USB ports are fine because the mouse works with them, the iMac will recognize either of two mouses, but not the keyboard. In fact, eventually it did start recognizing the keyboard in only the volume buttons. They would sporadically click themselves mute/volume down etc. Then I noticed that it would recognize my clicking of only those three buttons, but I was fighting against some ghost clicks. Then I actually noticed that I didn't even have to "click" the buttons, just the physical energy presence of my hand near the buttons would cause the, to "fire". Weird! So I start thinking about power source, but both the iMac and the tester MacBook are plugged into the same surge protector on the same outlet. I can't even login because I can't type anything. Apple should really have a "click keyboard" feature already installed. That should not be something that the user has to think of ahead of time and prep for, a bit ridiculous. Anyway, sorry this is long but it was needed to explain all the details of what I've already tried. Suggestions?
iMac 27″, macOS 10.15