Java Code Examples for android.view.KeyEvent#META_ALT_LEFT_ON

The following examples show how to use android.view.KeyEvent#META_ALT_LEFT_ON . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LatinIME.java    From hackerskeyboard with Apache License 2.0 5 votes vote down vote up
private int getMetaState(boolean shifted) {
    int meta = 0;
    if (shifted) meta |= KeyEvent.META_SHIFT_ON | KeyEvent.META_SHIFT_LEFT_ON;
    if (mModCtrl) meta |= KeyEvent.META_CTRL_ON | KeyEvent.META_CTRL_LEFT_ON;
    if (mModAlt) meta |= KeyEvent.META_ALT_ON | KeyEvent.META_ALT_LEFT_ON;
    if (mModMeta) meta |= KeyEvent.META_META_ON | KeyEvent.META_META_LEFT_ON;
    return meta;
}
 
Example 2
Source File: LatinIME.java    From hackerskeyboard with Apache License 2.0 5 votes vote down vote up
private void sendAltKey(InputConnection ic, boolean isDown, boolean chording) {
    if (chording && delayChordingAltModifier()) return;

    int key = sKeyboardSettings.chordingAltKey;
    if (key == 0) key = KeyEvent.KEYCODE_ALT_LEFT;
    int meta = KeyEvent.META_ALT_ON | KeyEvent.META_ALT_LEFT_ON;
    if (isDown) {
        sendKeyDown(ic, key, meta);
    } else {
        sendKeyUp(ic, key, meta);
    }
}
 
Example 3
Source File: KeyEventCompat.java    From CodenameOne with GNU General Public License v2.0 5 votes vote down vote up
@Override
public int normalizeMetaState(int metaState) {
    if ((metaState & (KeyEvent.META_SHIFT_LEFT_ON | KeyEvent.META_SHIFT_RIGHT_ON)) != 0) {
        metaState |= KeyEvent.META_SHIFT_ON;
    }
    if ((metaState & (KeyEvent.META_ALT_LEFT_ON | KeyEvent.META_ALT_RIGHT_ON)) != 0) {
        metaState |= KeyEvent.META_ALT_ON;
    }
    return metaState & META_ALL_MASK;
}
 
Example 4
Source File: KeyEventCompat.java    From adt-leanback-support with Apache License 2.0 5 votes vote down vote up
@Override
public int normalizeMetaState(int metaState) {
    if ((metaState & (KeyEvent.META_SHIFT_LEFT_ON | KeyEvent.META_SHIFT_RIGHT_ON)) != 0) {
        metaState |= KeyEvent.META_SHIFT_ON;
    }
    if ((metaState & (KeyEvent.META_ALT_LEFT_ON | KeyEvent.META_ALT_RIGHT_ON)) != 0) {
        metaState |= KeyEvent.META_ALT_ON;
    }
    return metaState & META_ALL_MASK;
}
 
Example 5
Source File: KeyEventCompat.java    From android-recipes-app with Apache License 2.0 5 votes vote down vote up
@Override
public int normalizeMetaState(int metaState) {
    if ((metaState & (KeyEvent.META_SHIFT_LEFT_ON | KeyEvent.META_SHIFT_RIGHT_ON)) != 0) {
        metaState |= KeyEvent.META_SHIFT_ON;
    }
    if ((metaState & (KeyEvent.META_ALT_LEFT_ON | KeyEvent.META_ALT_RIGHT_ON)) != 0) {
        metaState |= KeyEvent.META_ALT_ON;
    }
    return metaState & META_ALL_MASK;
}
 
Example 6
Source File: KeyEventCompat.java    From V.FlyoutTest with MIT License 5 votes vote down vote up
@Override
public int normalizeMetaState(int metaState) {
    if ((metaState & (KeyEvent.META_SHIFT_LEFT_ON | KeyEvent.META_SHIFT_RIGHT_ON)) != 0) {
        metaState |= KeyEvent.META_SHIFT_ON;
    }
    if ((metaState & (KeyEvent.META_ALT_LEFT_ON | KeyEvent.META_ALT_RIGHT_ON)) != 0) {
        metaState |= KeyEvent.META_ALT_ON;
    }
    return metaState & META_ALL_MASK;
}
 
Example 7
Source File: KeyEventCompat.java    From guideshow with MIT License 5 votes vote down vote up
@Override
public int normalizeMetaState(int metaState) {
    if ((metaState & (KeyEvent.META_SHIFT_LEFT_ON | KeyEvent.META_SHIFT_RIGHT_ON)) != 0) {
        metaState |= KeyEvent.META_SHIFT_ON;
    }
    if ((metaState & (KeyEvent.META_ALT_LEFT_ON | KeyEvent.META_ALT_RIGHT_ON)) != 0) {
        metaState |= KeyEvent.META_ALT_ON;
    }
    return metaState & META_ALL_MASK;
}