List of usage examples for android.view KeyEvent META_META_MASK
int META_META_MASK
To view the source code for android.view KeyEvent META_META_MASK.
Click Source Link
From source file:org.distantshoresmedia.keyboard.LatinIME.java
public void updateShiftKeyState(EditorInfo attr) { InputConnection ic = getCurrentInputConnection(); if (ic != null && attr != null && mKeyboardSwitcher.isAlphabetMode()) { int oldState = getShiftState(); boolean isShifted = mShiftKeyState.isChording(); boolean isCapsLock = (oldState == Keyboard.SHIFT_CAPS_LOCKED || oldState == Keyboard.SHIFT_LOCKED); boolean isCaps = isCapsLock || getCursorCapsMode(ic, attr) != 0; //Log.i(TAG, "updateShiftKeyState isShifted=" + isShifted + " isCaps=" + isCaps + " isMomentary=" + mShiftKeyState.isMomentary() + " cursorCaps=" + getCursorCapsMode(ic, attr)); int newState = Keyboard.SHIFT_OFF; if (isShifted) { newState = (mSavedShiftState == Keyboard.SHIFT_LOCKED) ? Keyboard.SHIFT_CAPS : Keyboard.SHIFT_ON; } else if (isCaps) { newState = isCapsLock ? getCapsOrShiftLockState() : Keyboard.SHIFT_CAPS; }/*from w w w. j a v a2 s . co m*/ //Log.i(TAG, "updateShiftKeyState " + oldState + " -> " + newState); mKeyboardSwitcher.setShiftState(newState); } if (ic != null) { // Clear modifiers other than shift, to avoid them getting stuck int states = KeyEvent.META_FUNCTION_ON | KeyEvent.META_ALT_MASK | KeyEvent.META_CTRL_MASK | KeyEvent.META_META_MASK | KeyEvent.META_SYM_ON; ic.clearMetaKeyStates(states); } }