I am having similar behavior with a new iPhone 5s. Suddenly the phone was launching new programs, typing in Safari's URL entry window, changing prefs in the settig window. I'm just sitting there watching this happen. The phone was plugged into AC power. As I forced quit programs, new ones would launch themselves. I tried to shut down the phone, but I couldn't slide the red ribbon sideways to shut the phone down. Eventually I did. When I rebooted, I couldn't enter my PIN because I would press one button, and another one would depress on the screen. Prees 0 and 4 would be entered.
I brought it in to Apple and a genius made me reset to the original OS with no non-start-up apps. I did, and the behavior returned. I brought it back and they thought that the touch screen was defective. They swapped the phone.
I just uploaded all my apps to the new phone, and a day later I'm watching a podcast in Safari and suddenly the podcast stops and I see typing in the Safari URL entry window. I see apps opening and I see random typing in random apps. Again, the phone is plugged into AC power.
This is a second phone. I just deleted non-Apple apps and we'll see what happens. So if no viruses exist, and this is only a oftware bug, one program can open another and start typing.
Has anyone heard of this behavior?