I see. Sounds like a script then? Take a look at AutoIt, my favorite for simple scripts.
Eg:
--- BEGIN AUTOIT CODE ---
WinActivate,Opera - Izaram
Send,{ENTER}
---- END AUTOIT CODE ----
Then you compile it into enter.exe and you double-click on it and it sends an ENTER to Opera, after it's been activated.
If you wanted it to just send ENTER then just remove the WinActivate line.
Is that what you had in mind?
http://www.hiddensoft.com/AutoIt/