JDK-8161082 : Key event consume() method doesn't work
  • Type: Bug
  • Component: javafx
  • Sub-Component: controls
  • Affected Version: 9
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2016-07-06
  • Updated: 2019-09-16
  • Resolved: 2016-07-26
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9Fixed
Related Reports
Relates :  
Description
Key event consume() method doesn't work.
Please use attached POC to reproduce.
Tagging as regression because it worked properly in older versions of 9 (e.g, 9 b13).

----
Below goes info from Evergreen test executors:

Testsuite name: FXCompatibilityManual
Test name(s): graphics/api/control/ToggleButtonTest2Test.java
Product(s) tested: JDK9b125 (64bit)
OS/architecture: Mac10.11-x64

Reproducible: Always
Reproducible on machine: Evergreen-machine
[If Sometimes] Also reproducible on machine:

Is it a Regression:
[If Regression] Regression introduced in release/build:
Test result on the last GAed release for this train:
[if Fail] Test result on FCS:

Is it a platform specific issue:
[If platform specific issue] Is it a new (previously unsupported) OS/browser/mode testing:
[If new configuration testing] Issue specific to execution mode or OS/browser version:

Steps to reproduce:
1. Install Test build JDK9b125 (64bit) and set JAVA_HOME env
2. use test bundle:java-client-9-manual.tar.gz and extract to a folder of java-client-9-manual <WS>
3. Install ANT (version:1.9.7) and set ANT_HOME env
4. Change javafx.home path in build.properties file(under the folder <WS>)
5 Enter the testsuite "JavaCompatibilityManual" directory(under the folder<WS>) and run command: ant run-manual
6. Run the case: graphics/api/control/ToggleButtonTest2Test.java in the harness.

Instructions:
1.Select the 'boundsInParent' Checkbox & rectangle is around the ToggleButton.
2.Click on the ToggleButton & press Left Arrow key . Observe that ToggleButton & boundsInParent rectangle translates left side.
3.Press Right Arrow key . Observe that ToggleButton & boundsInParent rectangle translates right side.
4.Press Up Arrow key. Observe that ToggleButton & boundsInParent rectangle translates Up side.
5.Press Down Arrow key. Observe that ToggleButton & boundsInParent rectangle translates Down side.

Actual result:
The Toggle button can not translate up/down side continuously when pressing up/down arrow key several times.
Press up arrow key once,the button translates up side and loses focus;
Press up arrow key again,the button can not translates up side.

By the way, JDK8 on mac, The Toggle button can translate up/down side continuously when pressing up/down arrow key several times
Comments
The target build for this fix is jdk-9+130.
29-07-2016

I have a fix that specifically works for the attached test (i.e. Radio / Toggle Buttons). However, I note that the bug summary is far more generic 'Key event consume() method doesn't work'. If there are additional issues, please file new bugs with attached test cases so that they can be tested with and fixed. Changeset: http://hg.openjdk.java.net/openjfx/9-dev/rt/rev/1156622f2b9f
26-07-2016

Disregard previous comment - it turns out my IDE was using a different JDK to what I expected, so I wasn't testing correctly. I can now reproduce the problem.
25-07-2016

Either I cannot reproduce the issue, or I am not understanding the issue. When I run the attached Main.java file, I click on the toggle, and then I press the up/down/left/right arrow keys on my keyboard. If I press and release, I can see that the toggle moves one step in that direction. If I press and hold, I can see that the toggle continues to move in the direction specified by the key I've pressed. Can you please re-test and clarify what the issue is, so that we are clear. By the way, I'm testing this on Mac OS X.
25-07-2016

There is the same issue happened on Ubuntu16.04-x64+jdk9b128-64bit. RULE "graphics/api/control/ListViewTest_4cTest.java" any any RULE "graphics/api/control/RadioButtonTest2Test.java" any any RULE "graphics/api/control/ToggleButtonTest2Test.java" any any
25-07-2016

Assigning to Jonathan (Control) for further investigation.
20-07-2016

Examined the change to scene graph specific classes (such as Node and Parent) and it doesn't seem likely to be the issue. This is pretty certain a control bug.
20-07-2016

Bisected the changes between b81 and b82 and found the bug was introduced by fix for JDK-8077916: changeset: 9244:5023330f0526 user: jgiles date: Thu Sep 10 11:21:20 2015 +1200 summary: 8077916: Complete development work for project one: make UI control skins public API
20-07-2016

This bug was introduced in JDK 9 build 82: java version "1.9.0-ea" Java(TM) SE Runtime Environment (build 1.9.0-ea-b82) Java HotSpot(TM) 64-Bit Server VM (build 1.9.0-ea-b82, mixed mode)
19-07-2016

I have verified that this works on latest 8u on Linux.
19-07-2016

This likely affects JDK 8u as well, so it would be helpful to know which 8u release it was introduced in.
18-07-2016

There is the same issue happened on Ubuntu16.04-x64+jdk9b126-64bit. RULE "graphics/api/control/ListViewTest_4cTest.java" any any RULE "graphics/api/control/RadioButtonTest2Test.java" any any RULE "graphics/api/control/ToggleButtonTest2Test.java" any any
13-07-2016

There's the same issue happened on Mac10.11-x64with JDK9b126/64bit in FXCompatibilityManual Test Instructions: Key LEFT: translates ListView by a factor of -20 each time the key is pressed, towards left. Key RIGHT: translates ListView by a factor of 20, towards right. Key 5: translates ListView downwards by a factor of 20 Key 6: translates ListView upwards by a factor of 20 1. Press the above mentioned keys repeatedly. Check the 'red' colored bounding rectangle shown around list view. The actual result: we can only press "RIGHT" one time,and then the ListView will lose focus. BTW,we can press "LEFT","5","6" many times. RULE "graphics/api/control/ListViewTest_4cTest.java" any any RULE "graphics/api/control/RadioButtonTest2Test.java" any any RULE "graphics/api/control/ToggleButtonTest2Test.java" any any
12-07-2016