My iMac has a mind of its own
I have a 12year old iMac which is typing gibberish and won't stop.
At first I thought it was the keyboard, then the mouse. Have installed new generic wireless keyboard and mouse but to no avail. When you click on anything to type it just takes over typing the same letter for pages and pages and doesn't stop.
iMac 21.5″, macOS 10.13