Hi! I'm Eric, a Mac expert who's been paired with you through JustAnswer.com. I'm reviewing your question now, and will return w/ an answer soon!
It sounds very much like MacOS thinks you've got a "stuck" key on your keyboard. Are you using the Apple Wireless Keyboard? If so, let's try to re-pair the keyboard and see if that helps.
To do it: turn your keyboard off, and then pull its batteries. Leave it in this "off" state for a full minute, and then replace the batteries and turn the keyboard back on. Your iMac should automatically re-pair with the keyboard. Did that resolve the issue?
If not, we can try to reset the SMC:
If it's *still* misbehaving after resetting the SMC, we can reset the NVRAM. To do it:
(After resetting NVRAM, you may need to reconfigure settings for speaker volume, screen resolution, startup disk selection, and time zone information.)
With any luck, one of the above steps will resolve this problem for you. If not, please know that we're committed to helping you resolve this issue...simply return to my.justanswer.com to give us an update, and we'll continue troubleshooting with you until we get this fixed!