Bug 363309-Key events posted with Display.post() do not honor
Shiftkey state
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java
index 0ac973f..39fc577 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java
@@ -2486,7 +2486,7 @@
 public static final int kCGPathStroke = 2;
 public static final int kCGScrollEventUnitLine = 1;
 public static final int kCGScrollEventUnitPixel = 0;
-public static final int kCGSessionEventTap = 1;
+public static final int kCGHIDEventTap = 0;
 public static final int kCGTextFillStroke = 2;
 public static final int kCTParagraphStyleSpecifierBaseWritingDirection = 13;
 public static final int kCTWritingDirectionLeftToRight = 0;
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 d0f387e..eeb4578 100644
--- 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
@@ -3151,7 +3151,7 @@
 					if (vKey == -1) {
 						for (short i = 0 ; i <= 0x7F ; i++) {
 							deadKeyState[0] = 0;
-							OS.UCKeyTranslate (uchrPtr, i, (short)(type == SWT.KeyDown ? OS.kUCKeyActionDown : OS.kUCKeyActionUp), OS.shiftKey, OS.LMGetKbdType(), 0, deadKeyState, maxStringLength, actualStringLength, output);
+							OS.UCKeyTranslate (uchrPtr, i, (short)(type == SWT.KeyDown ? OS.kUCKeyActionDown : OS.kUCKeyActionUp), (OS.shiftKey >> 8) & 0xFF, OS.LMGetKbdType(), 0, deadKeyState, maxStringLength, actualStringLength, output);
 							if (output[0] == event.character) {
 								vKey = i;
 								break;
@@ -3230,12 +3230,12 @@
 		// returnValue is true if we called CGPostKeyboardEvent (10.5 only).
 		if (returnValue == false) {
 			if (eventRef != 0) {
+				OS.CGEventPost(OS.kCGHIDEventTap, eventRef);
+				OS.CFRelease(eventRef);
 				try {
 					Thread.sleep(1);
 				} catch (Exception e) {
 				}
-				OS.CGEventPost(OS.kCGSessionEventTap, eventRef);
-				OS.CFRelease(eventRef);
 				returnValue = true;
 			}
 		}