-
Enhancement
-
Resolution: Unresolved
-
P4
-
8u20
-
Windows 7, x64
32-bit Java runtime
Awt offered a getKeyLocation() as a member of java.awt.event.KeyEvent.
When an awt component is added to a JavaFX Parent, this method is incorrectly implemented and always returns KEY_LOCATION_UNKNOWN (tested in a java.awt.event.KeyListener on JTextField, JLabel, ...).
Moreover, this method should be provided in native JavaFX key events, for key listeners to determine exactly which key is pressed. What makes it worse is the javafx.scene.input.KeyEvent::getCode method returns UNDEFINED for several keys, and applications have to check a combination of getCode, getText, in order to determine only inaccurate data on the pressed key.
When an awt component is added to a JavaFX Parent, this method is incorrectly implemented and always returns KEY_LOCATION_UNKNOWN (tested in a java.awt.event.KeyListener on JTextField, JLabel, ...).
Moreover, this method should be provided in native JavaFX key events, for key listeners to determine exactly which key is pressed. What makes it worse is the javafx.scene.input.KeyEvent::getCode method returns UNDEFINED for several keys, and applications have to check a combination of getCode, getText, in order to determine only inaccurate data on the pressed key.
- csr for
-
JDK-8190201 [SwingNode] getKeyLocation not correctly implemented with JavaFX
- Closed
- duplicates
-
JDK-8090524 [KeyEvent, KeyCode] Provide a way to distinguish between left and right version of the key (like Control, Alt, etc...)
- Closed