From: BobHanson Date: Thu, 11 Jun 2020 12:13:36 +0000 (-0500) Subject: Merge branch 'Jalview-JS/develop.JAL-3446.ctrlDown' into X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=ae737f35e5185aa421563e4c061340a3c4152514;p=jalview.git Merge branch 'Jalview-JS/develop.JAL-3446.ctrlDown' into Jalview-JS/develop Conflicts: src/jalview/bin/JalviewJS2.java src/jalview/gui/Desktop.java src/jalview/util/Platform.java --- ae737f35e5185aa421563e4c061340a3c4152514 diff --cc src/jalview/bin/JalviewJS2.java index 544f5d7,6f69f8a..61b3487 --- a/src/jalview/bin/JalviewJS2.java +++ b/src/jalview/bin/JalviewJS2.java @@@ -36,11 -36,11 +36,11 @@@ public class JalviewJS args = new String[] { // "headless", "open", "examples/uniref50.fa", -- "features", -- "examples/exampleFeatures.txt" -- , "noannotation" - , "showoverview" - // , "png", "test-bh.png" ++// "features", ++// "examples/exampleFeatures.txt" ++// , "noannotation" + //, "showoverview" + //, "png", "test-bh.png" }; } diff --cc src/jalview/gui/Desktop.java index a1d9a09,0e2fcf0..3d91e47 --- a/src/jalview/gui/Desktop.java +++ b/src/jalview/gui/Desktop.java @@@ -2506,12 -2446,9 +2506,18 @@@ public class Desktop extends GDeskto */ protected void addQuitHandler() { ++<<<<<<< HEAD + getRootPane() + .getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put( + KeyStroke + .getKeyStroke(KeyEvent.VK_Q, + jalview.util.ShortcutKeyMaskExWrapper + .getMenuShortcutKeyMaskEx()), ++======= + getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW) + .put(KeyStroke.getKeyStroke(KeyEvent.VK_Q, + Platform.SHORTCUT_KEY_MASK), ++>>>>>>> refs/heads/Jalview-JS/develop.JAL-3446.ctrlDown "Quit"); getRootPane().getActionMap().put("Quit", new AbstractAction() { diff --cc src/jalview/util/Platform.java index b1b6697,6dbe549..371cd32 --- a/src/jalview/util/Platform.java +++ b/src/jalview/util/Platform.java @@@ -209,31 -230,14 +239,14 @@@ public class Platfor */ protected static boolean isControlDown(MouseEvent e, boolean aMac) { - if (!aMac) - { - return e.isControlDown(); - - // Jalview 2.11 code below: above is as amended for JalviewJS - // /* - // * answer false for right mouse button - // */ - // if (e.isPopupTrigger()) - // { - // return false; - // } - // return - // (jalview.util.ShortcutKeyMaskExWrapper.getMenuShortcutKeyMaskEx() // - // .getMenuShortcutKeyMaskEx() - // & jalview.util.ShortcutKeyMaskExWrapper - // .getModifiersEx(e)) != 0; // getModifiers()) != 0; - } - // answer false for right mouse button - // shortcut key will be META for a Mac - return !e.isPopupTrigger() - && (Toolkit.getDefaultToolkit().getMenuShortcutKeyMask() - & e.getModifiers()) != 0; - // could we use e.isMetaDown() here? - ++ + System.out.println(e.isPopupTrigger() + + " " + ((SHORTCUT_KEY_MASK & e.getModifiersEx()) != 0) + + " " + e.isControlDown()); + return (aMac ? !e.isPopupTrigger() + && (SHORTCUT_KEY_MASK & e.getModifiersEx()) != 0 + : e.isControlDown()); - } + } // BH: I don't know about that previous method. Here is what SwingJS uses. // Notice the distinction in mouse events. (BUTTON3_MASK == META)