From: Ben Soares Date: Tue, 18 Jun 2019 11:49:32 +0000 (+0100) Subject: JAL-3312 Fixed SHIFT-CMD/SHIFT-CTRL Key combinations missing SHIFT X-Git-Tag: Release_2_11_0~7^2~3 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=0463505c7b197602965764e4cfdfb335fdf2408b;p=jalview.git JAL-3312 Fixed SHIFT-CMD/SHIFT-CTRL Key combinations missing SHIFT --- 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()