Buggy code:
protected void destroy ( ) { } void destroyDisplay ( ) { } public void disposeExec ( Runnable runnable ) { } void error ( int code ) { } boolean filterEvent ( Event event ) { } boolean filters ( int eventType ) { } public Widget findWidget ( int handle ) { } public Widget findWidget ( int handle , int id ) { } public Widget findWidget ( Widget widget , int id ) { } public static Display findDisplay ( Thread thread ) { } public Shell getActiveShell ( ) { } public Rectangle getBounds ( ) { } Rectangle getBounds ( NSArray screens ) { } public static Display getCurrent ( ) { } int getCaretBlinkTime ( ) { } public Rectangle getClientArea ( ) { } public Control getCursorControl ( ) { } public Point getCursorLocation ( ) { } public Point [ ] getCursorSizes ( ) { } public static Display getDefault ( ) { } public Object getData ( String key ) { } public Object getData ( ) { } public int getDismissalAlignment ( ) { } public int getDoubleClickTime ( ) { } public Control getFocusControl ( ) { } static Control GetFocusControl ( NSWindow window ) { } public boolean getHighContrast ( ) { } public int getIconDepth ( ) { } public Point [ ] getIconSizes ( ) { } int getLastEventTime ( ) { } Menu [ ] getMenus ( Decorations shell ) { } int getMessageCount ( ) { } public Monitor [ ] getMonitors ( ) { } NSRect getPrimaryFrame ( ) { } public Monitor getPrimaryMonitor ( ) { } public Shell [ ] getShells ( ) { } public Synchronizer getSynchronizer ( ) { } public Thread getSyncThread ( ) { } public Color getSystemColor ( int id ) { } Color getWidgetColor ( int id ) { } public Cursor getSystemCursor ( int id ) { } public Image getSystemImage ( int id ) { } public Tray getSystemTray ( ) { } public Thread getThread ( ) { } int getToolTipTime ( ) { } Widget getWidget ( int id ) { } static Widget GetWidget ( int id ) { } Widget getWidget ( NSView view ) { } boolean hasDefaultButton ( ) { } protected void init ( ) { } void initApplicationDelegate ( ) { } void addEventMethods ( int cls , int proc2 , int proc3 , int drawRectProc , int hitTestProc , int needsDisplayInRectProc ) { } void addFrameMethods ( int cls , int setFrameOriginProc , int setFrameSizeProc ) { } void addAccessibilityMethods ( int cls , int proc2 , int proc3 , int proc4 , int accessibilityHitTestProc ) { } int registerCellSubclass ( int cellClass , int size , int align , byte [ ] types ) { } void initClasses ( ) { } NSFont getFont ( int cls , int sel ) { } void initFonts ( ) { } public int internal_new_GC ( GCData data ) { } public void internal_dispose_GC ( int context , GCData data ) { } static boolean isValidClass ( Class clazz ) { } boolean isValidThread ( ) { } public boolean post ( Event event ) { synchronized ( Device . class ) { if ( isDisposed ( ) ) error ( ERROR_DEVICE_DISPOSED ) ; if ( event == null ) error ( ERROR_NULL_ARGUMENT ) ; if ( ! ( eventSourceDelaySet ) ) { OS . CGSetLocalEventsSuppressionInterval ( 0.0 ) ; <START_BUG> OS . CGEnableEventStateCombining ( true ) ; <END_BUG> OS . CGSetLocalEventsFilterDuringSuppressionState ( ( ( ( OS . kCGEventFilterMaskPermitLocalKeyboardEvents ) | ( OS . kCGEventFilterMaskPermitLocalMouseEvents ) ) | ( OS . kCGEventFilterMaskPermitSystemDefinedEvents ) ) , kCGEventSuppressionStateSuppressionInterval ) ; OS . CGSetLocalEventsFilterDuringSuppressionState ( ( ( ( OS . kCGEventFilterMaskPermitLocalKeyboardEvents ) | ( OS . kCGEventFilterMaskPermitLocalMouseEvents ) ) | ( OS . kCGEventFilterMaskPermitSystemDefinedEvents ) ) , kCGEventSuppressionStateRemoteMouseDrag ) ; eventSourceDelaySet = true ; } int type = event . type ; switch ( type ) { case SWT . KeyDown : case SWT . KeyUp : { short vKey = ( ( short ) ( Display . untranslateKey ( event . keyCode ) ) ) ; if ( vKey == 0 ) { int uchrPtr = 0 ; int currentKbd = OS . TISCopyCurrentKeyboardInputSource ( ) ; int uchrCFData = OS . TISGetInputSourceProperty ( currentKbd , OS . kTISPropertyUnicodeKeyLayoutData ( ) ) ; if ( uchrCFData == 0 ) return false ; uchrPtr = OS . CFDataGetBytePtr ( uchrCFData ) ; if ( uchrPtr == 0 ) return false ; if ( ( OS . CFDataGetLength ( uchrCFData ) ) == 0 ) return false ; int maxStringLength = 256 ; vKey = - 1 ; char [ ] output = new char [ maxStringLength ] ; int [ ] actualStringLength = new int [ 1 ] ; for ( short i = 0 ; i <= 127 ; i ++ ) { OS . UCKeyTranslate ( uchrPtr , i , ( ( short ) ( type == ( SWT . KeyDown ) ? OS . kUCKeyActionDown : OS . kUCKeyActionUp ) ) , 0 , OS . LMGetKbdType ( ) , 0 , deadKeyState , maxStringLength , actualStringLength , output ) ; if ( ( output [ 0 ] ) == ( event . character ) ) { vKey = i ; break ; } } if ( vKey == ( - 1 ) ) { for ( short i = 0 ; i <= 127 ; i ++ ) { OS . UCKeyTranslate ( uchrPtr , i , ( ( short ) ( type == ( SWT . KeyDown ) ? OS . kUCKeyActionDown : OS . kUCKeyActionUp ) ) , shiftKey , OS . LMGetKbdType ( ) , 0 , deadKeyState , maxStringLength , actualStringLength , output ) ; if ( ( output [ 0 ] ) == ( event . character ) ) { vKey = i ; break ; } } }

Fix:
OS . CGEnableEventStateCombining ( 1 ) ;