changeset 4266:406c46acc988

automated merge
author tb115823 <Tomas.Brandalik@oracle.com>
date Thu, 11 Jul 2013 10:29:20 +0200
parents f3c2a366c257 49b61ba17f67
children 944dc6ad49d4 d801cd33f3e9
files
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/modules/swing/src/main/java/javafx/embed/swing/SwingNode.java	Thu Jul 11 10:25:33 2013 +0200
+++ b/modules/swing/src/main/java/javafx/embed/swing/SwingNode.java	Thu Jul 11 10:29:20 2013 +0200
@@ -630,6 +630,15 @@
             int swingModifiers = SwingEvents.fxKeyModsToKeyMods(event);
             int swingKeyCode = event.getCode().impl_getCode();
             char swingChar = event.getCharacter().charAt(0);
+
+            // A workaround. Some swing L&F's process mnemonics on KEY_PRESSED,
+            // for which swing provides a keychar. Extracting it from the text.
+            if (event.getEventType() == javafx.scene.input.KeyEvent.KEY_PRESSED) {
+                String text = event.getText();
+                if (text.length() == 1) {
+                    swingChar = text.charAt(0);
+                }
+            }
             long swingWhen = System.currentTimeMillis();
             java.awt.event.KeyEvent keyEvent = new java.awt.event.KeyEvent(
                     frame, swingID, swingWhen, swingModifiers,