<AWT Dev> [9] Review request for 8169355: Diacritics input works incorrectly on Windows if Spanish (Latin American) keyboard layout is used

dmitry markov dmitry.markov at oracle.com
Wed Nov 9 10:36:40 UTC 2016


Hello,

Could you review a fix for jdk9, please?

     bug: https://bugs.openjdk.java.net/browse/JDK-8169355
     webrev: http://cr.openjdk.java.net/~dmarkov/8169355/webrev.00/

Problem description:
The new mechanism of dead keys detection and processing was introduced 
by JDK-8139189 <https://bugs.openjdk.java.net/browse/JDK-8139189>. It 
uses MapVirtualKey() function to detect dead key combination. Also an 
output of MapVirtualKey() invocation is used as a value which is send 
with Java's KEY_PRESSED/KEY_RELEASED events. However if the mechanism, 
(i.e. WindowsKeyToJavaChar() function inside awtComponent.cpp) is called 
from the Java layer via JNI right after a keyboard layout has been 
changed, MapVirtualKey() returns a character value related to the 
previous keyboard layout.

Fix:
The function WindowsKeyToJavaChar() has to take into account the current 
keyboard layout, (i.e. MapVirtualKey() should be replaced with 
MapVirtualKeyEx()).

Note: the corresponding regression tests, (e.g. 
java/awt/InputMethods/DiacriticsTest/DiacriticsTest.html) passed on the 
build with fix.

Thanks,
Dmitry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/awt-dev/attachments/20161109/eb1432ed/attachment.html>


More information about the awt-dev mailing list