[Tutor] Tutor Digest, Vol 50, Issue 84

Tony Cappellini cappy2112 at gmail.com
Tue Apr 29 14:40:19 CEST 2008


I think you may have to send a message to the event look of you application
manually,
to let it know you have a key event for it. You may also need to temporarily
enable/disbale the keydown event handler for pyHook, or else you wont be
able to easily break out of  that code (at least I couldn't) :-)
You might want to post your message on the Python Win32 list. This issue is
specific to Window event handling and there are a lot of people on that
list who probably can help with this specific issue.

Message: 7
Date: Tue, 29 Apr 2008 12:46:29 +0530
From: "Muguntharaj Subramanian" <mugunth at gmail.com>
Subject: [Tutor] pyHook related doubt
To: Tutor at python.org
Message-ID:
       <8dd9fd0804290016p5a6c91ebx249eb05e87bdf451 at mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Hi All,
I am trying to create a custom keyboard driver program(like
http://www.tavultesoft.com/keyman/ ) for windows using python.
If this python script is run in the background, what is typed should be
converted into my native language.
For example if I hit 'a' in the keyboard, the output of the keyboard should
be a tamil unicode character(which will be pre-defined by user).

For making such program, i tried exploring pyHook based on this tutorial.
http://mindtrove.info/articles/monitoring-global-input-with-pyhook/

>From the tutorial, I have learned to capture the keys typed, but couldn't
understand how to change the keys before they reach the windows
applications.

Attached is the sample code I used (In this code basically i am trying to
change all the keys typed to 'b' in this code, but its not working )

Please guide me on how i can change the keys sent to the application using
pyHook. Or is there any other library that I can make use of to create such
application.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20080429/d62e86d0/attachment.htm>


More information about the Tutor mailing list