Jump to content

Looking 4 a way to send a keyboard press to a specific window


G+_Bob Samuelson
 Share

Recommended Posts

Thanks for the link.  Looks like what  I was searching for.  Portability not an issue and focused window only will work for my application......

EDITED 3:45 CDT .. does exactly what I was looking for.  Thanks for the help!

import win32com.client

import win32api

 

shell = win32com.client.Dispatch("WScript.Shell")

shell.Run("notepad") # comment out if notepad is currently running.

win32api.Sleep(100)

shell.AppActivate("notepad")

win32api.Sleep(100)

shell.SendKeys("e")

win32api.Sleep(3500)

shell.SendKeys("e")

win32api.Sleep(2500)

Link to comment
Share on other sites

 Share

×
×
  • Create New...