Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT PI/carbon/org/eclipse/swt/internal/carbon/MacEvent.java')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/carbon/org/eclipse/swt/internal/carbon/MacEvent.java26
1 files changed, 5 insertions, 21 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/org/eclipse/swt/internal/carbon/MacEvent.java b/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/org/eclipse/swt/internal/carbon/MacEvent.java
index 6d329c7e98..f0c2bb120f 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/org/eclipse/swt/internal/carbon/MacEvent.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/org/eclipse/swt/internal/carbon/MacEvent.java
@@ -101,35 +101,19 @@ public class MacEvent {
* Returns the SWT modifiers for this event
*/
public int getStateMask() {
-
int stateMask= fgMouseButtonState;
-
- int modifiers= getModifiers();
-
- if ((modifiers & OS.shiftKey) != 0)
- stateMask |= SWT.SHIFT;
-
+ int modifiers= getModifiers ();
+ if ((modifiers & OS.shiftKey) != 0) stateMask |= SWT.SHIFT;
if ((modifiers & OS.controlKey) != 0) {
if (EMULATE_RIGHT_BUTTON) {
// we only report CONTROL, iff it was not used to emulate the right mouse button
- if ((stateMask & SWT.BUTTON3) == 0)
- stateMask |= SWT.CONTROL;
+ if ((stateMask & SWT.BUTTON3) == 0) stateMask |= SWT.CONTROL;
} else {
stateMask |= SWT.CONTROL;
}
}
-
- if ((modifiers & OS.cmdKey) != 0) {
- // the Command modifier is always mapped to Control
- stateMask |= SWT.CONTROL;
-
- // if the Command modifier is pressed we report the Option modifier as 'ALT'
- if ((modifiers & OS.optionKey) != 0)
- stateMask |= SWT.ALT;
- } else {
- // we don't report the option modifier as 'ALT'
- }
-
+ if ((modifiers & OS.cmdKey) != 0) stateMask |= SWT.COMMAND;
+ if ((modifiers & OS.optionKey) != 0) stateMask |= SWT.ALT;
return stateMask;
}

Back to the top