JAL-2077 handling Cmd-click in scale panel for Mac / Windows
[jalview.git] / src / jalview / util / Platform.java
index 786f5bf..85a27f6 100644 (file)
@@ -78,10 +78,21 @@ public class Platform
     return f.toString();
   }
 
+  /**
+   * Answers true if the mouse event has Meta-down (on Mac) or Ctrl-down (on
+   * other o/s)
+   * 
+   * @param e
+   * @return
+   */
   public static boolean isControlDown(MouseEvent e)
   {
-    return (jalview.util.Platform.isAMac() ? (Toolkit.getDefaultToolkit()
-            .getMenuShortcutKeyMask() & e.getModifiers()) != 0 : e
-            .isControlDown());
+    if (isAMac())
+    {
+      return (Toolkit.getDefaultToolkit().getMenuShortcutKeyMask() & e
+              .getModifiers()) != 0;
+      // could we use e.isMetaDown() here?
+    }
+    return e.isControlDown();
   }
 }