(surprisingly, to me :-) the keyID identifier binding modifiers are not “supported”: while you can create and associate them with inputMap, they are never detected, because keyStrokes created inside typed keys really use keyChar and ignore modifiers. This creation occurs in JComponent.processKeyBindings (...)
boolean processKeyBindings(KeyEvent e, boolean pressed) { if (!SwingUtilities.isValidKeyEventForKeyBindings(e)) { return false; }
Reflecting on this, this may make sense: pressing / disabling controls physical keys, and typed controls the resulting combined “output” of one or more physical keys. If no valid keyChar exists for any given combination, then the keyTyped event is not generated.
The main problem is the famous usa-centrism of swing / awt developers: they are considered physical keys only on the user's layout ;-) In no way (what I know) to get other keys in the layout is the diagnostic method. Hope that turns out to be erroneous
kleopatra
source share