- 
    Type:
Bug
 - 
    Resolution: Fixed
 - 
    Priority:
  P3                     
     - 
    Affects Version/s: 8u40
 - 
    Component/s: javafx
 - 
    Environment:
Linux, JDK 8u40-b02
 
                    Below is a test case that shows how KeyCombination matching is broken.
I'm using JDK 8u40-b02 on Linux.
import javafx.application.Platform;
import javafx.embed.swing.JFXPanel;
import javafx.scene.input.KeyCharacterCombination;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyEvent;
public class KeyCombinationTest {
public static void main(String[] args) {
new JFXPanel(); // initialize JavaFX
KeyCharacterCombination a = new KeyCharacterCombination("a");
KeyCharacterCombination A = new KeyCharacterCombination("A");
KeyCharacterCombination b = new KeyCharacterCombination("b");
KeyCharacterCombination B = new KeyCharacterCombination("B");
KeyCharacterCombination LF = new KeyCharacterCombination("\n");
KeyCharacterCombination CR = new KeyCharacterCombination("\r");
KeyCharacterCombination TAB = new KeyCharacterCombination("\t");
KeyEvent event = new KeyEvent(KeyEvent.KEY_TYPED, "a", "", KeyCode.UNDEFINED, false, false, false, false);
System.out.println("a match a: " + a.match(event)); // false (!!!)
System.out.println("A match a: " + A.match(event)); // true (!!!)
System.out.println("b match a: " + b.match(event)); // false
System.out.println("B match a: " + B.match(event)); // true (!!!)
System.out.println("LF match A: " + LF.match(event)); // true (!!!)
System.out.println("CR match A: " + CR.match(event)); // true (!!!)
System.out.println("TAB match A: " + TAB.match(event)); // true (!!!)
Platform.exit();
}
}
OUTPUT:
a match a: false
A match a: true
b match a: false
B match a: true
LF match A: true
CR match A: true
TAB match A: true
I'm using JDK 8u40-b02 on Linux.
import javafx.application.Platform;
import javafx.embed.swing.JFXPanel;
import javafx.scene.input.KeyCharacterCombination;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyEvent;
public class KeyCombinationTest {
public static void main(String[] args) {
new JFXPanel(); // initialize JavaFX
KeyCharacterCombination a = new KeyCharacterCombination("a");
KeyCharacterCombination A = new KeyCharacterCombination("A");
KeyCharacterCombination b = new KeyCharacterCombination("b");
KeyCharacterCombination B = new KeyCharacterCombination("B");
KeyCharacterCombination LF = new KeyCharacterCombination("\n");
KeyCharacterCombination CR = new KeyCharacterCombination("\r");
KeyCharacterCombination TAB = new KeyCharacterCombination("\t");
KeyEvent event = new KeyEvent(KeyEvent.KEY_TYPED, "a", "", KeyCode.UNDEFINED, false, false, false, false);
System.out.println("a match a: " + a.match(event)); // false (!!!)
System.out.println("A match a: " + A.match(event)); // true (!!!)
System.out.println("b match a: " + b.match(event)); // false
System.out.println("B match a: " + B.match(event)); // true (!!!)
System.out.println("LF match A: " + LF.match(event)); // true (!!!)
System.out.println("CR match A: " + CR.match(event)); // true (!!!)
System.out.println("TAB match A: " + TAB.match(event)); // true (!!!)
Platform.exit();
}
}
OUTPUT:
a match a: false
A match a: true
b match a: false
B match a: true
LF match A: true
CR match A: true
TAB match A: true
- relates to
 - 
                    
JDK-8087486 [Glass, Linux, Mac, Monocle] KeyCharacterCombination matching for tab and newline is broken
-         
     - Open
 
 -