I am not a tecchie, but I have been rattling around BT issues for quite sometime.
What's the best way of proceeding?
Reset the PRAM and SMC.
Trash a preference file (com.apple.bluetooth.plist) and restart.
If that does not work, to implement your plan #2, delete the BT keyboard from the other Mac. Delete the BT KB (failing one) from the Mac in question. Turn the "new and old" BT KB's off. Restart the Mac (no USB KB attached now) and turn the "new" BT KB on.
That is a bit convoluted...hopefully it is somewhat clear.
Thank you for your response.
I apologize for the long delay. I had a higher-priority tech crisis that needed solving sooner. In the meantime, I retrofitted an old wired Apple keyboard to replace the failing wireless one.
So, some days have passed. Both machines have been restarted at least once. I stared at the both keyboards, scratched my head, and tested each one with its factory-paired mac. The potential replacement worked. Cool. (Now I can put it away.) The previously failing keyboard also worked. Even cooler!
I have NO idea why the passage of time solved the problem. I have no idea how a badly confused keyboard could, without any particular treatment, become lucid. (I've written keyboard firmware in the distant past, so I have some basis for an opinion.) I'm going to guess that something in Bluetooth was ... confused. Good a theory as any, right?
I'm going to keep note of your suggestions in case the problem re-occurs.
Nope, the keyboard failed again.
Removing and re-pairing seemed to solve all problems except one: the single-quote key seems defective. I think it acted as if it was stuck "down". Well, that would confuse any keyboard <grin>.
So, I followed Plan "B": I unpaired the spare wireless keyboard from the nearby iMac, and paired it with the afflicted iMac. Problem solved! At least for now.
Now, I'm going to look for some help on cleaning the failing keyboard. Hmmm, the keycaps don't seem to pop off easily as in the old days...
To add to this discussion and maybe to help others. Over the past 6 months I have been having on and off problems with the Apple BT keyboard and number pad. Sometime it will not responde and other times all I would get are the strang charactors. Other have seen both on this keyboard as wel as the keyboard on Macbooks.
There has been a couple of course of actions that people found to resolve the issue. One is to turn off the computer and then restart, this cause the keyboard to reconnect with the computer which may or may not fix the problem. Other had luck doing a PRAM reset on boot up. Other simple just unpair and repaired the keyboard. I personally just pull out the battery for a 5 or 10 seconds and then put them back in and power up and it will repair and reconnect and the problem goes away. I personally think this is some sort of BT communication software stack issue, I have seen similar issue on cell phones with BT devices. Somehow the BT connection gets corrupted and the only way to clear it is to disconnect/remove power and repair the device.
If the above has not solve the problem then you have to look at the hardware. Some people reported that their keyboard was dirty and keys were sticking specifically the cmd and control keys which make sense since they are the lowest on the keyboard and dirt will migrate there. Since the key travel is so small it make sense to clear your keyboard often to get the dirt and dust out of it.