src/macosx/classes/sun/lwawt/macosx/CPlatformResponder.java

Print this page

        

*** 39,48 **** --- 39,49 ---- */ final class CPlatformResponder { private final LWWindowPeer peer; private final boolean isNpapiCallback; + private int lastKeyPressCode = KeyEvent.VK_UNDEFINED; CPlatformResponder(final LWWindowPeer peer, final boolean isNpapiCallback) { this.peer = peer; this.isNpapiCallback = isNpapiCallback; }
*** 181,190 **** --- 182,194 ---- int jmodifiers = NSEvent.nsToJavaKeyModifiers(modifierFlags); long when = System.currentTimeMillis(); + if (jeventType == KeyEvent.KEY_PRESSED) { + lastKeyPressCode = jkeyCode; + } peer.dispatchKeyEvent(jeventType, when, jmodifiers, jkeyCode, javaChar, jkeyLocation); // Current browser may be sending input events, so don't // post the KEY_TYPED here.
*** 211,220 **** --- 215,228 ---- c = text.charAt(index); peer.dispatchKeyEvent(KeyEvent.KEY_TYPED, System.currentTimeMillis(), 0, KeyEvent.VK_UNDEFINED, c, KeyEvent.KEY_LOCATION_UNKNOWN); + peer.dispatchKeyEvent(KeyEvent.KEY_RELEASED, + System.currentTimeMillis(), + 0, lastKeyPressCode, c, + KeyEvent.KEY_LOCATION_UNKNOWN); index++; } } }