<AWT Dev> <AWT dev>[9] Review request for 8139189: VK_OEM_102 dead key detected as VK_UNDEFINED

Semyon Sadetsky semyon.sadetsky at oracle.com
Tue May 17 09:23:19 UTC 2016


Please review fix for JDK9:

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

The Programmer Dvorak keyboard layout uses compose-like key that allow 
type glyphed letters like diacritic or caron.
This functionality does not work in JDK since the 
https://bugs.openjdk.java.net/browse/JDK-4053800 fix which changed key 
to java character mapping procedure to use ToAscii() call wiche later 
was replaced by ToUnicodeEx() call. Both ToAscii() and ToUnicodeEx() 
unrecoverably change the window state related to the keyboard during key 
converting, so all dedicated dead keys stop to work. That is the root 
cause of the issue.
Since those converting calls are required obtain UTF character for the 
JDK KEY_PRESSED event at the moment of WM_KEYDOWN before, it is 
impossible to get the UTF character for the dead key combination without 
breaking it, because the resulting symbol will only be ready after the 
WM_CHAR event designating that combination is over.
As a work-around the proposed fix does not call ToUnicodeEx() after dead 
key combination is started and uses the MapVirtualKey() call return as 
the value to send with java's KEY_PRESSED/KEY_RELEASED events.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/awt-dev/attachments/20160517/1a1e60a5/attachment.html>

More information about the awt-dev mailing list