Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Redor2014-08-05 07:22:42 +0000
committerLaurent Redor2014-08-05 07:22:42 +0000
commit00a1a085ddeb914aac003daff78e646984372257 (patch)
tree27262a18423163a8ff4b13495af3560001f858f7
parent0d3a50f97a5eaef1ea6c20f3f02e57621921b63a (diff)
downloadorg.eclipse.sirius-00a1a085ddeb914aac003daff78e646984372257.tar.gz
org.eclipse.sirius-00a1a085ddeb914aac003daff78e646984372257.tar.xz
org.eclipse.sirius-00a1a085ddeb914aac003daff78e646984372257.zip
[441134] Use M1 key binding instead of Ctrl
This allows Mac users to call a tool twice (or more) by pressing cmd key. Bug: 441134 Change-Id: I6b0a2bd5f09bb5766ddb8896885566b20ce876be Signed-off-by: Laurent Redor <laurent.redor@obeo.fr>
-rw-r--r--plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/palette/ConnectionCreationTool.java5
-rw-r--r--plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/palette/CreationTool.java5
2 files changed, 6 insertions, 4 deletions
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/palette/ConnectionCreationTool.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/palette/ConnectionCreationTool.java
index 1d84b46ec6..e2331c5e4d 100644
--- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/palette/ConnectionCreationTool.java
+++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/palette/ConnectionCreationTool.java
@@ -16,6 +16,7 @@ import org.eclipse.gef.SnapToHelper;
import org.eclipse.gef.commands.Command;
import org.eclipse.gef.requests.CreateConnectionRequest;
import org.eclipse.gef.requests.CreationFactory;
+import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Cursor;
/**
@@ -63,11 +64,11 @@ public class ConnectionCreationTool extends org.eclipse.gef.tools.ConnectionCrea
/**
* Overridden so that the current tool will remain active (locked) if the
- * user is pressing the ctrl key.
+ * user is pressing the ctrl key (or cmd key for mac users).
*/
@Override
protected void handleFinished() {
- if (!getCurrentInput().isControlKeyDown()) {
+ if (!getCurrentInput().isModKeyDown(SWT.MOD1)) {
super.handleFinished();
} else {
reactivate();
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/palette/CreationTool.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/palette/CreationTool.java
index fd815b9f69..d2bdf6e756 100644
--- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/palette/CreationTool.java
+++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/palette/CreationTool.java
@@ -16,6 +16,7 @@ import org.eclipse.gef.Request;
import org.eclipse.gef.SnapToHelper;
import org.eclipse.gef.requests.CreateRequest;
import org.eclipse.gef.requests.CreationFactory;
+import org.eclipse.swt.SWT;
/**
* CreationTool so that the current tool will remain active (locked) if the user
@@ -54,11 +55,11 @@ public class CreationTool extends org.eclipse.gef.tools.CreationTool {
/**
* Overridden so that the current tool will remain active (locked) if the
- * user is pressing the ctrl key.
+ * user is pressing the ctrl key (or cmd key for mac users).
*/
@Override
protected void handleFinished() {
- if (!getCurrentInput().isControlKeyDown()) {
+ if (!getCurrentInput().isModKeyDown(SWT.MOD1)) {
super.handleFinished();
} else {
reactivate();

Back to the top