[Python-bugs-list] PythonWin crash on dead keys (PR#372)
Wed, 28 Jun 2000 10:33:26 +1000
Thanks for reporting this. Ill look into it.
In general, this bug mechanism is for Python itself, and not the Python for
Win32 extensions. Its probably best to simply mail future bugs in the
Win32 stuff directly to me.
> -----Original Message-----
> From: firstname.lastname@example.org
> [mailto:email@example.com]On Behalf Of
> Sent: Tuesday, 27 June 2000 11:08 PM
> To: firstname.lastname@example.org
> Cc: email@example.com
> Subject: [Python-bugs-list] PythonWin crash on dead keys (PR#372)
> Full_Name: Gottfried Gan▀auge
> Version: 1.5.2
> OS: Windows 2000
> Submission from: joshua2go.dynix.de (220.127.116.11)
> I'm using PyWin32 build 132, but the problem occurs with build
> 129 as well.
> Every time I hit one of the dead keys on my keyboard (`, ^)
> PythonWin crashes.
> I traced the error back to the routine ui_translate_vk() in
> The call to ToAsciiEx() with a dead key's scan code returns -1 and in the
> following call to PyString_FromStringAndSize() this eventually
> leads to the
> In my opininion the reason for that lies before the call to this routine.
> pywin hooks WM_KEYDOWN in several places and doesn't check for
> dead keys but
> tries to translate the scan code to an ASCII character.
> With dead keys this obviously must fail.
> Windows itself already does the correct translation as described in the
> Platform SDK article about Dead-Character Messages:
> <Quote on>
> Some non-English keyboards contain character keys that are not
> expected to
> produce characters by themselves. Instead, they are used to add
> a diacritic to
> the character produced by the subsequent keystroke. These keys
> are called dead
> keys. The circumflex key on a German keyboard is an example of a
> dead key. To
> enter the character consisting of an "o" with a circumflex, a
> German user would
> type the circumflex key followed by the "o" key. The window with
> the keyboard
> focus would receive the following sequence of messages:
> <Quote off>
> Consequently pywin should ignore WM_KEYDOWN messages completely
> if they are
> produced by a dead key.
> I tried to implement that using the current win32api implementation, but
> unfortunately the necessary API-Function to find out if a key is
> a dead key are
> not provided in the current implementation; namely the MapVirtualKey(Ex)
> Cheers, and keep up the good work
> Python-bugs-list maillist - Pythonfirstname.lastname@example.org