Search this forum for SendInput. You'll find plenty of examples.