Merge remote-tracking branch 'origin/GP-5978-dragonmacher-alt-graph-fix'

(Closes #8205)
This commit is contained in:
Ryan Kurtz 2025-09-10 14:09:33 -04:00
commit 59bcbba8cf

View file

@ -15,7 +15,6 @@
*/ */
package docking.action; package docking.action;
import java.awt.event.InputEvent;
import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener; import java.beans.PropertyChangeListener;
import java.util.*; import java.util.*;
@ -103,9 +102,6 @@ public class KeyBindingsManager implements PropertyChangeListener {
// map standard keystroke to action // map standard keystroke to action
doAddKeyBinding(provider, action, keyStroke); doAddKeyBinding(provider, action, keyStroke);
// map workaround keystroke to action
fixupAltGraphKeyStrokeMapping(provider, action, keyStroke);
} }
public String validateActionKeyBinding(DockingActionIf dockingAction, KeyStroke ks) { public String validateActionKeyBinding(DockingActionIf dockingAction, KeyStroke ks) {
@ -145,24 +141,6 @@ public class KeyBindingsManager implements PropertyChangeListener {
return null; return null;
} }
private void fixupAltGraphKeyStrokeMapping(ComponentProvider provider, DockingActionIf action,
KeyStroke keyStroke) {
// special case
int modifiers = keyStroke.getModifiers();
if ((modifiers & InputEvent.ALT_DOWN_MASK) == InputEvent.ALT_DOWN_MASK) {
//
// Also register the 'Alt' binding with the 'Alt Graph' mask. This fixes the but
// on Windows (https://bugs.openjdk.java.net/browse/JDK-8194873)
// that have different key codes for the left and right Alt keys.
//
modifiers |= InputEvent.ALT_GRAPH_DOWN_MASK;
KeyStroke updateKeyStroke =
KeyStroke.getKeyStroke(keyStroke.getKeyCode(), modifiers, false);
doAddKeyBinding(provider, action, updateKeyStroke, keyStroke);
}
}
private void doAddKeyBinding(ComponentProvider provider, DockingActionIf action, private void doAddKeyBinding(ComponentProvider provider, DockingActionIf action,
KeyStroke keyStroke) { KeyStroke keyStroke) {
doAddKeyBinding(provider, action, keyStroke, keyStroke); doAddKeyBinding(provider, action, keyStroke, keyStroke);