I have seen the same thing happen with a sticky keyboard.
I very much doubt it is a virus, there are currently zero viruses in the wild for the Mac.
This begs the question, did you download anything and run it before this happened?
Even those "proof of concept" viruses that exist in lab conditions are unable to spread from machine to machine without being physically downloaded and given permission to run.
P
I have a Mac G4 running OS 10.4.9. The strangest thing happened today. The titles of my folders began to be replaced by 6s and + signs (6 6 ++6, etc.). It started with the main disk drive, then went like Pacman to eat the titles of the folders on that drive. Fortunately, I saw it start and shut everything down immediately. When I started up again, the 4 or 5 folders still contained the 6+ names (which I didn't copy down) and I changed them back to their correct name. What could cause that? What triggered this request was a question about viruses. Is this a virus? I've been using Macs since the early 80s and never experienced this before. Thanks.

Chowhound
Comic Vine
GameFAQs
GameSpot
Giant Bomb
TechRepublic