// we make a copy rather than edit the current selection if no
// modifiers pressed
// see Enhancement JAL-1557
- if (!(evt.isControlDown() || evt.isShiftDown()))
+ if (!(jalview.util.Platform.isControlDown(evt) || evt
+ .isShiftDown()))
{
sg = new SequenceGroup(sg);
sg.clear();
}
else
{
- if (evt.isControlDown())
+ if (jalview.util.Platform.isControlDown(evt))
{
sg.addOrRemove(aa[selectedRow].sequenceRef, true);
}
}
if ((av.getSelectionGroup() == null)
- || ((!e.isControlDown() && !e.isShiftDown()) && av
+ || ((!jalview.util.Platform.isControlDown(e) && !e
+ .isShiftDown()) && av
.getSelectionGroup() != null))
{
av.setSelectionGroup(new SequenceGroup());
// we make a copy rather than edit the current selection if no
// modifiers pressed
// see Enhancement JAL-1557
- if (!(evt.isControlDown() || evt.isShiftDown()))
+ if (!(jalview.util.Platform.isControlDown(evt) || evt
+ .isShiftDown()))
{
sg = new SequenceGroup(sg);
sg.clear();
}
else
{
- if (evt.isControlDown())
+ if (jalview.util.Platform.isControlDown(evt))
{
sg.addOrRemove(aa[selectedRow].sequenceRef, true);
}
return;
}
-
if ((av.getSelectionGroup() == null)
- || ((!e.isControlDown() && !e.isShiftDown()) && av
- .getSelectionGroup() != null))
+ || (!jalview.util.Platform.isControlDown(e)
+ && !e.isShiftDown() && av.getSelectionGroup() != null))
{
av.setSelectionGroup(new SequenceGroup());
av.getSelectionGroup().setStartRes(0);
*/
package jalview.util;
+import java.awt.Toolkit;
+import java.awt.event.MouseEvent;
+
/**
* System platform information used by Applet and Application
*
f.append(file.substring(lastp));
return f.toString();
}
+
+ public static boolean isControlDown(MouseEvent e)
+ {
+ return (jalview.util.Platform.isAMac() ? (Toolkit.getDefaultToolkit()
+ .getMenuShortcutKeyMask() & e.getModifiers()) != 0 : e
+ .isControlDown());
+ }
}