Software keyboard

Mike vimakefile at
Thu Nov 24 20:11:54 CET 2005

You need to call keybd_event which is (or was in win3.x - win95 at least) in 

Simulate return keypress:

Google turned this up:
Note: This is old stuff -- you'll need to handle different versions of 
windows where that DLL and API are rennamed -- I beleive it is now 

SendMessage and Windows hooks can also work, but not as well in all 

If you feel nervous about programming this, you can probably find/buy a COM 
component that will do this and call it from Python that way.

But, this would seem to fit the bill out-of-the-box:


"maxxx_77" <massimopone at> wrote in message 
news:1132819597.002388.114480 at
> Hello. I'm a newbye of Python.
> I'm looking for a way of coding a virtual keyboard similar to the one
> that comes with Windows (Accessories -> Accessibility -> On Screen
> Keyboard).
> What I would like to do is make one which is a lot larger and add
> transparency to it.
> I've a first version in which I used TKinter and Pythonwin.
> Can anyone provide me with a snipet of code which would explain how to
> send characters to other applications?
> The first difficulty that I have is to find which application is active
> and has the focus. I think that my keyboard application must be
> modeless and cannot receive the focus. But how?
> Please help me.
> Bye.

More information about the Python-list mailing list