Sunday, April 25, 2010

SendKeysCtypes release (for some value of released)

I finally got around to releasing SendKeysCtypes (Sending key strokes to the active app on Windows) to

There is no yet, it is not registered on PYPI - but at least it is available.

I did a quick check and had to make a small change to make it work on Python 3.1 :)

Give it a try.

I would like to thank Oliver Rutherford for his sendkeys module ( which I have used for years as part of pywinauto.

I only just realized while writing this that it is also posted to bitbucket

The main benefits between this module and Oliver's that I can think of are:

  • No compilation required (works on Python 3)
  • Support for Unicode Characters

Code that works for one of these modules should work for the other also

import SendKeysCtypes
import os, time
os.system("start notepad.exe")
SendKeysCtypes.SendKeys("Hello in Notepad", with_spaces = True)
SendKeysCtypes.SendKeys("%f") # ALT + F "File" menu
SendKeysCtypes.SendKeys("x") # Exit

No comments:

Post a Comment