Buggy code:
boolean fixKey ( int [ ] keysym , byte [ ] buffer , int state ) { } int focusProc ( int w , int client_data , int call_data , int continue_to_dispatch ) { } public Shell getActiveShell ( ) { } public static Display getCurrent ( ) { } public static Display findDisplay ( Thread thread ) { } int getCaretBlinkTime ( ) { } 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 ( ) { } public boolean getHighContrast ( ) { } public int getIconDepth ( ) { } public Point [ ] getIconSizes ( ) { } int getLastEventTime ( ) { } int getMessageCount ( ) { } public Monitor [ ] getMonitors ( ) { } public Monitor getPrimaryMonitor ( ) { } public Shell [ ] getShells ( ) { } public Synchronizer getSynchronizer ( ) { } public Thread getSyncThread ( ) { } public Color getSystemColor ( int id ) { } public Cursor getSystemCursor ( int id ) { } public Font getSystemFont ( ) { } public Image getSystemImage ( int style ) { } public Tray getSystemTray ( ) { } public Thread getThread ( ) { } Widget getWidget ( int handle ) { } void hideToolTip ( ) { } protected void init ( ) { } void initializeButton ( ) { } void initializeComposite ( ) { } void initializeDefaults ( ) { } void initializeDialog ( ) { } void initializeDisplay ( ) { } void initializeLabel ( ) { } void initializeList ( ) { } void initializeNumLock ( ) { } void initializePixmaps ( ) { } void initializeScrollBar ( ) { } void initializeSystemColors ( ) { } void initializeText ( ) { } void initializeTranslations ( ) { } void initializeWidgetTable ( ) { } public int internal_new_GC ( GCData data ) { } public void internal_dispose_GC ( int gc , GCData data ) { } boolean isValidThread ( ) { } static boolean isValidClass ( Class clazz ) { } public Point map ( Control from , Control to , Point point ) { } public Point map ( Control from , Control to , int x , int y ) { } public Rectangle map ( Control from , Control to , Rectangle rectangle ) { } public Rectangle map ( Control from , Control to , int x , int y , int width , int height ) { } int mouseHoverProc ( int handle , int id ) { } public boolean post ( Event event ) { synchronized ( Device . class ) { if ( isDisposed ( ) ) error ( ERROR_DEVICE_DISPOSED ) ; if ( event == null ) error ( ERROR_NULL_ARGUMENT ) ; int type = event . type ; switch ( type ) { case SWT . KeyDown : case SWT . KeyUp : { int keyCode = 0 ; int keysym = Display . untranslateKey ( event . keyCode ) ; if ( keysym != 0 ) keyCode = OS . XKeysymToKeycode ( xDisplay , keysym ) ; if ( keyCode == 0 ) { char key = event . character ; switch ( key ) { case SWT . BS : keysym = OS . XK_BackSpace ; break ; case SWT . CR : keysym = OS . XK_Return ; break ; case SWT . DEL : keysym = OS . XK_Delete ; break ; case SWT . ESC : keysym = OS . XK_Escape ; break ; case SWT . TAB : keysym = OS . XK_Tab ; break ; case SWT . LF : keysym = OS . XK_Linefeed ; break ; default : <START_BUG> keysym = Display . wcsToMbcs ( key ) ; <END_BUG> } keyCode = OS . XKeysymToKeycode ( xDisplay , keysym ) ; if ( keyCode == 0 ) return false ; } OS . XTestFakeKeyEvent ( xDisplay , keyCode , ( type == ( SWT . KeyDown ) ) , 0 ) ; return true ; } case SWT . MouseDown : case SWT . MouseMove : case SWT . MouseUp : { if ( type == ( SWT . MouseMove ) ) { OS . XTestFakeMotionEvent ( xDisplay , ( - 1 ) , event . x , event . y , 0 ) ; return true ; } else { int button = event . button ; if ( ( button < 1 ) || ( button > 3 ) ) return false ; OS . XTestFakeButtonEvent ( xDisplay , button , ( type == ( SWT . MouseDown ) ) , 0 ) ; return true ; } } } return false ; } } void postEvent ( Event event ) { } public boolean readAndDispatch ( ) { } static void register ( Display display ) { } protected void release ( ) { } void releaseDisplay ( ) { } void releaseToolTipHandle ( int handle ) { } void removeMouseHoverTimeOut ( ) { } Widget removeWidget ( int handle ) { } void removePopup ( Menu menu ) { } public void removeFilter ( int eventType , Listener listener ) { } public void removeListener ( int eventType , Listener listener ) { } boolean runAsyncMessages ( boolean all ) { } boolean runDeferredEvents ( ) { } boolean runFocusOutEvents ( ) { } boolean runPopups ( ) { } void sendEvent ( int eventType , Event event ) { } void sendFocusEvent ( Control control , int type ) { } public void setCursorLocation ( int x , int y ) { }

Fix:
keysym = key ;