/* * Called by the delegate when a key is pressed. */ @Override public void notifyKeyEvent( int id, long when, int modifiers, int keyCode, char keyChar, int keyLocation) { LWKeyboardFocusManagerPeer kfmPeer = LWKeyboardFocusManagerPeer.getInstance(); Component focusOwner = kfmPeer.getCurrentFocusOwner(); if (focusOwner == null) { focusOwner = kfmPeer.getCurrentFocusedWindow(); if (focusOwner == null) { focusOwner = this.getTarget(); } } postEvent(new KeyEvent(focusOwner, id, when, modifiers, keyCode, keyChar, keyLocation)); }
/* * Called by the delegate when a key is pressed. */ @Override public void notifyKeyEvent( int id, long when, int modifiers, int keyCode, char keyChar, int keyLocation) { LWKeyboardFocusManagerPeer kfmPeer = LWKeyboardFocusManagerPeer.getInstance(); Component focusOwner = kfmPeer.getCurrentFocusOwner(); if (focusOwner == null) { focusOwner = kfmPeer.getCurrentFocusedWindow(); if (focusOwner == null) { focusOwner = this.getTarget(); } } KeyEvent keyEvent = new KeyEvent(focusOwner, id, when, modifiers, keyCode, keyChar, keyLocation); AWTAccessor.getKeyEventAccessor() .setExtendedKeyCode( keyEvent, (keyChar == KeyEvent.CHAR_UNDEFINED) ? keyCode : ExtendedKeyCodes.getExtendedKeyCodeForChar(keyChar)); postEvent(keyEvent); }