[owner-abiword-dev@abisource.com: BOUNCE abiword-dev@abisource.com: Non-member submission from ["Lukas Pietsch" <pietsch@mail.uni-freiburg.de>]]


Subject: [owner-abiword-dev@abisource.com: BOUNCE abiword-dev@abisource.com: Non-member submission from ["Lukas Pietsch" ]]
From: Sam TH (sam@uchicago.edu)
Date: Wed Dec 20 2000 - 16:23:42 CST


                                sam th
                                sam@uchicago.edu
                                http://www.abisource.com/~sam
                                GnuPG Key:
                                http://www.abisource.com/~sam/key

attached mail follows:


>From owner-abiword-dev@abisource.com Wed Dec 20 11:20:15 2000
Return-Path: <owner-abiword-dev@abisource.com>
Delivered-To: abiword-dev@abisource.com
Received: from sibm7.ruf.uni-freiburg.de (sibm7.ruf.uni-freiburg.de [132.230.7.17])
        by parsons.abisource.com (Postfix) with ESMTP id 44A8812B80C
        for <abiword-dev@abisource.com>; Wed, 20 Dec 2000 11:20:14 -0600 (CST)
Received: from ppp (remote142-165.home.uni-freiburg.de [132.230.142.165]) by sibm7.ruf.uni-freiburg.de (AIX4.3/UCB 8.8.8/8.8.8) with SMTP id SAA28816 for <abiword-dev@abisource.com>; Wed, 20 Dec 2000 18:20:09 +0100
Message-ID: <000d01c06aa8$f6ada900$a58ee684@home.unifreiburg.de>
From: "Lukas Pietsch" <pietsch@mail.uni-freiburg.de>
To: <abiword-dev@abisource.com>
Subject: International keyboard support in Win98
Date: Wed, 20 Dec 2000 18:18:29 +0100
MIME-Version: 1.0
Content-Type: text/plain;
        charset="utf-8"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200

Hello everybody,

I posted a bug report about Abiword's deficient handling of
keyboard input of non-ascii characters yesterday. I've been
trying to understand what's going on, and here is what I found
out after browsing through Microsoft's MSDN. I haven't got the
Abiword source code here, though. Maybe somebody can check if I'm
guessing right?

Apparently, what happens is this: when I try to switch to a new
keyboard layout, say, from German to Turkish, Abiword
acknowledges to the system that the change has taken place. The
system then starts using the Turkish keyboard driver to translate
physical keyboard "scan codes" into
"virtual keycodes", but Abiword still uses the German keyboard
driver to translate these virtual keycodes into character codes.
The result is chaos.

More detailed description: The system sends Abiword a
"WM_INPUTLANGCHANGEREQUEST" message. Abiword accepts it. The
system then activates the new keyboard layout driver and, when
done, sends out another "WM_INPUTLANGCHANGE". This message
contains a handle to the new keyboard language (HKL) as a
parameter. I suppose Abiword is expected to store this value
somewhere.

After that, when I type, the system sends WM_KEYDOWN messages to
Abiword. These messages contain "virtual-key" codes which Windows
has calculated using the new keyboard layout. Normally, the
application is expected to pass these back to another Windows
API, TranslateMessage, to let the system translate these into
character codes and send them back to the application in a
WM_CHAR message. The system has kept track of the keyboard
settings and will again use the correct, Turkish, translation
table.

However, there seem to be a number of alternative API's that
allow an unruly application to go it alone. For instance, an
application can translate a virtual-key code into a character
code using the ToAscii or ToAsciiEx functions. With the ToAsciiEx
function, the application can specify a keyboard layout handle
(HKL) of its own choice.

Is this what Abiword is doing? Trying to be clever and stay in
control of everything, Abiword keeps telling the system which HKL
to use. Unfortunately, it has forgotten to keep track of the
correct HKL when the system provided it; so it always passes the
HKL to the default keyboard language.

If that's what's happening, then it shouldn't be too difficult to
fix, right?

-----------------------------------------------------
Lukas Pietsch
University of Freiburg
English Department

Phone (p.) (#49) (761) 696 37 23
mailto:pietsch@mail.uni-freiburg.de




This archive was generated by hypermail 2b25 : Wed Dec 20 2000 - 16:23:43 CST