This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mdehoon
Recipients
Date 2005-02-04.13:08:38
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=488897

I agree, this is basically the same bug as #798058. The call
to readline.call_input_hook sounds like a good solution. But
the hook function should be different than the current
EventHook in _tkinter.c. That hook function sits in a loop
until a keyboard event is noticed. A problem occurs if there
is more than one hook function. Currently, that is not
possible in Python, since there is only one PyOS_InputHook.
I am working on a patch in which PyOS_InputHook is replaced
by PyOS_AddInputHook and PyOS_RemoveInputHook, so that there
can be more than one hook functions.

Now suppose that there is one hook function to handle Tk
events, and another one e.g. handling messages to windows in
Microsoft Windows. (This is a real issue for one of my
extension modules). If python sits in a loop in _tkinter.c's
EventHook until a key is pressed, the MS windows won't get
their messages.

The following structure might work better:

while(there is no keyboard input or other interesting event) {
            Call PyOS_InputHook #1
            Call PyOS_InputHook #2
            etc.
}
where each of the PyOS_InputHook functions should return if
there is no more work for them. The tricky part is to find
out which events to wait for; some of the events may be
handled by one of the PyOS_InputHook functions.

Obviously I need to do some more thinking about this.
History
Date User Action Args
2007-08-23 15:38:37adminlinkissue989712 messages
2007-08-23 15:38:37admincreate