Running the following:
KeyStroke ks1 = KeyStroke.getKeyStroke('s', KeyEvent.ALT_MASK);
KeyStroke ks2 = KeyStroke.getKeyStroke(KeyEvent.VK_S, KeyEvent.ALT_MASK);
KeyStroke ks3 = KeyStroke.getKeyStroke(KeyEvent.VK_F4, KeyEvent.ALT_MASK);
System.out.println(ks1);
System.out.println(ks2);
System.out.println(ks3);
Results in:
alt pressed F4
alt pressed S
alt pressed F4
This is because:
intvalue for thechar's' is 115KeyEvent.VK_F4is also 115meaning that
k1andk3are functionally the same.