From 0463505c7b197602965764e4cfdfb335fdf2408b Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Tue, 18 Jun 2019 12:49:32 +0100 Subject: [PATCH] JAL-3312 Fixed SHIFT-CMD/SHIFT-CTRL Key combinations missing SHIFT --- src/jalview/util/ShortcutKeyMaskExWrapper.java | 10 ++++++---- src/jalview/util/ShortcutKeyMaskExWrapper11.java | 12 ++++++++++-- src/jalview/util/ShortcutKeyMaskExWrapper8.java | 11 +++++++++-- 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/src/jalview/util/ShortcutKeyMaskExWrapper.java b/src/jalview/util/ShortcutKeyMaskExWrapper.java index c9ed231..f73b8d4 100644 --- a/src/jalview/util/ShortcutKeyMaskExWrapper.java +++ b/src/jalview/util/ShortcutKeyMaskExWrapper.java @@ -23,14 +23,16 @@ public class ShortcutKeyMaskExWrapper if (specversion >= modern) { - wrapper = new ShortcutKeyMaskExWrapper11(); + wrapper = new jalview.util.ShortcutKeyMaskExWrapper11(); + SHIFT_DOWN_MASK = jalview.util.ShortcutKeyMaskExWrapper11.SHIFT_DOWN_MASK; + ALT_DOWN_MASK = jalview.util.ShortcutKeyMaskExWrapper11.ALT_DOWN_MASK; } else { - wrapper = new ShortcutKeyMaskExWrapper8(); + wrapper = new jalview.util.ShortcutKeyMaskExWrapper8(); + SHIFT_DOWN_MASK = jalview.util.ShortcutKeyMaskExWrapper8.SHIFT_DOWN_MASK; + ALT_DOWN_MASK = jalview.util.ShortcutKeyMaskExWrapper8.ALT_DOWN_MASK; } - SHIFT_DOWN_MASK = wrapper.SHIFT_DOWN_MASK; - ALT_DOWN_MASK = wrapper.ALT_DOWN_MASK; } public static int getMenuShortcutKeyMaskEx() diff --git a/src/jalview/util/ShortcutKeyMaskExWrapper11.java b/src/jalview/util/ShortcutKeyMaskExWrapper11.java index 41a6aa0..7a3c8ca 100644 --- a/src/jalview/util/ShortcutKeyMaskExWrapper11.java +++ b/src/jalview/util/ShortcutKeyMaskExWrapper11.java @@ -7,8 +7,15 @@ import java.awt.event.MouseEvent; public class ShortcutKeyMaskExWrapper11 implements ShortcutKeyMaskExWrapperI { - public final static int SHIFT_DOWN_MASK = KeyEvent.SHIFT_DOWN_MASK; - public final static int ALT_DOWN_MASK = KeyEvent.ALT_DOWN_MASK; + public final static int SHIFT_DOWN_MASK; + + public final static int ALT_DOWN_MASK; + + static + { + SHIFT_DOWN_MASK = KeyEvent.SHIFT_DOWN_MASK; + ALT_DOWN_MASK = KeyEvent.ALT_DOWN_MASK; + } @Override public int getMenuShortcutKeyMaskEx() @@ -31,4 +38,5 @@ public class ShortcutKeyMaskExWrapper11 implements ShortcutKeyMaskExWrapperI return e.getModifiersEx(); } + } diff --git a/src/jalview/util/ShortcutKeyMaskExWrapper8.java b/src/jalview/util/ShortcutKeyMaskExWrapper8.java index 78254b5..a7817bd 100644 --- a/src/jalview/util/ShortcutKeyMaskExWrapper8.java +++ b/src/jalview/util/ShortcutKeyMaskExWrapper8.java @@ -7,8 +7,15 @@ import java.awt.event.MouseEvent; public class ShortcutKeyMaskExWrapper8 implements ShortcutKeyMaskExWrapperI { - public final static int SHIFT_DOWN_MASK = KeyEvent.SHIFT_MASK; - public final static int ALT_DOWN_MASK = KeyEvent.ALT_MASK; + public final static int SHIFT_DOWN_MASK; + + public final static int ALT_DOWN_MASK; + + static + { + SHIFT_DOWN_MASK = KeyEvent.SHIFT_MASK; + ALT_DOWN_MASK = KeyEvent.ALT_MASK; + } @Override public int getMenuShortcutKeyMaskEx() -- 1.7.10.2