Merge branch 'Jalview-JS/develop.JAL-3446.ctrlDown' into
authorBobHanson <hansonr@stolaf.edu>
Thu, 11 Jun 2020 12:13:36 +0000 (07:13 -0500)
committerBobHanson <hansonr@stolaf.edu>
Thu, 11 Jun 2020 12:13:36 +0000 (07:13 -0500)
Jalview-JS/develop

Conflicts:
src/jalview/bin/JalviewJS2.java
src/jalview/gui/Desktop.java
src/jalview/util/Platform.java

1  2 
src/jalview/bin/JalviewJS2.java
src/jalview/gui/Desktop.java
src/jalview/gui/SplitFrame.java
src/jalview/jbgui/GAlignFrame.java
src/jalview/jbgui/GDesktop.java
src/jalview/util/Platform.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"
        };
      }
  
@@@ -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()
      {
Simple merge
Simple merge
Simple merge
@@@ -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)