[wxPython] Anomalous behavior of OnCharHook

Hi,

According to the documentation, <wxEvent>.KeyCode() should return an ordinal
number (ASCII code) corresponding to the key pressed, but I don't get this
behavior... Here is a code fragment (incidentally, the following is within
a wxDialog-derived class):

    def HTML_window_OnChar(self,event):
        for pair in self.button_shortcuts:
            print (
                                                "Checking %s, which has the
"
                                                "key code %d, against the "
                                                "event with key code %d\n"
                                                % (pair,

ord(string.lower(pair[1])),
                                                   event.KeyCode())
                                                )

            if event.KeyCode() == ord(string.lower(pair[1])):
                print "button %d pressed" % pair[0]

self.button_shortcuts is a list of the form [(1, 'd'), (2, 'e'), (3, 'm')].

I do

          EVT_CHAR_HOOK(self,self.HTML_window_OnChar)

in the dialog's __init__. This is on a Windows 98 system, using wxPython
version 2.1.14-20000319.

I get

Checking (1, 'd'), which has the key code 100, against the event with key
code 309

Checking (2, 'e'), which has the key code 101, against the event with key
code 309

Checking (3, 'm'), which has the key code 109, against the event with key
code 309

for LEAVE_WINDOW type events [not keypress events at all!], and a similar
message with 32 [respectively 8] instead of 309, when I press SPACE
(respectively BACKSPACE]--the expected behavior--but nothing whatsoever for
a keypress like 'd'. Can anyone explani this behavior--which seems to be a
bug, although I have is annoying tendency to make really STUPID errors and
not notice them for AGES...

Many thanks...
Chris