summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Kovatch <skovatch>2010-11-08 17:47:46 +0000
committerScott Kovatch <skovatch>2010-11-08 17:47:46 +0000
commite90c375678ef655c49b0e97ff5454120ca5ea785 (patch)
tree0d50a3fb0dcb573f522d4ddccc1510d4eb0573f4
parent5d349ccba41d0f7ef226037e533a9e5997cf8ec1 (diff)
downloadeclipse.platform.swt-e90c375678ef655c49b0e97ff5454120ca5ea785.tar.gz
eclipse.platform.swt-e90c375678ef655c49b0e97ff5454120ca5ea785.tar.xz
eclipse.platform.swt-e90c375678ef655c49b0e97ff5454120ca5ea785.zip
329511 - Use CGEventCreateKeyboardEvent instead of CGPostKeyboardEvent, which is deprecated.
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java
index 0357874a61..129bee4735 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java
@@ -3011,8 +3011,9 @@ public boolean post(Event event) {
}
if (vKey == -1) return false;
-
- return OS.CGPostKeyboardEvent((short)0, vKey, type == SWT.KeyDown) == 0;
+ int /*long*/ eventRef = OS.CGEventCreateKeyboardEvent(0, vKey, type == SWT.KeyDown);
+ OS.CGEventPost(0, eventRef);
+ return true;
}
case SWT.MouseDown:
case SWT.MouseMove: