Code example for KeyEvent

Methods: getActiongetEventTimegetKeyCodegetMetaStategetUnicodeCharisSystem

0
            action != KeyEvent.ACTION_UP) {
            // action == KeyEvent.ACTION_MULTIPLE 
            // TODO(bulach): confirm the actual behavior. Apparently: 
            // If event.getKeyCode() == KEYCODE_UNKNOWN, we can send a 
            // composition key down (229) followed by a commit text with the 
            // string from event.getUnicodeChars(). 
            // Otherwise, we'd need to send an event with a 
            // WebInputEvent::IsAutoRepeat modifier. We also need to verify when 
            // we receive ACTION_MULTIPLE: we may receive it after an ACTION_DOWN, 
            // and if that's the case, we'll need to review when to send the Char 
            // event. 
            return false; 
        } 
        mViewEmbedder.onImeEvent(false);
        return nativeSendKeyEvent(mNativeImeAdapterAndroid, event, event.getAction(),
                getModifiers(event.getMetaState()), event.getEventTime(), event.getKeyCode(),
                                event.isSystem(), event.getUnicodeChar());
    } 
 
    private void setInputConnection(AdapterInputConnection inputConnection) {
        mInputConnection = inputConnection;
    } 
 
    private static int getModifiers(int metaState) {
        int modifiers = 0;
        if ((metaState & KeyEvent.META_SHIFT_ON) != 0) {
          modifiers |= sModifierShift;
        } 
        if ((metaState & KeyEvent.META_ALT_ON) != 0) {