Code example for KeyEvent

Methods: getMetaStategetUnicodeChar

0
            case KeyEvent.KEYCODE_BACK:
                result = mBackKeyCode;
                break; 
 
            default: { 
                int metaState = event.getMetaState();
                chordedCtrl = ((META_CTRL_ON & metaState) != 0);
                boolean effectiveCaps = allowToggle && (mCapKey.isActive());
                boolean effectiveAlt = allowToggle && mAltKey.isActive();
                int effectiveMetaState = metaState & (~META_CTRL_MASK);
                if (effectiveCaps) {
                    effectiveMetaState |= KeyEvent.META_SHIFT_ON;
                } 
                if (!allowToggle && (effectiveMetaState & META_ALT_ON) != 0) {
                    effectiveAlt = true;
                } 
                if (effectiveAlt) {
                    if (mAltSendsEsc) {
                        mTermSession.write(new byte[]{0x1b}, 0, 1);
                        effectiveMetaState &= ~KeyEvent.META_ALT_MASK;
                    } else if (SUPPORT_8_BIT_META) {
                        setHighBit = true;
                        effectiveMetaState &= ~KeyEvent.META_ALT_MASK;
                    } else { 
                        effectiveMetaState |= KeyEvent.META_ALT_ON;
                    } 
                } 
 
                if ((metaState & KeyEvent.META_META_ON) != 0) {
                    if (mAltSendsEsc) {
                        mTermSession.write(new byte[]{0x1b}, 0, 1);
                        effectiveMetaState &= ~KeyEvent.META_META_MASK;
                    } else { 
                        if (SUPPORT_8_BIT_META) {
                            setHighBit = true;
                            effectiveMetaState &= ~KeyEvent.META_META_MASK;
                        } 
                    } 
                } 
                result = event.getUnicodeChar(effectiveMetaState);
 
                if ((result & KeyCharacterMap.COMBINING_ACCENT) != 0) {
 
                    mCombiningAccent = result & KeyCharacterMap.COMBINING_ACCENT_MASK;
                    return;