Example usage for android.view.inputmethod InputConnection getCursorCapsMode

List of usage examples for android.view.inputmethod InputConnection getCursorCapsMode

Introduction

In this page you can find the example usage for android.view.inputmethod InputConnection getCursorCapsMode.

Prototype

int getCursorCapsMode(int reqModes);

Source Link

Document

Retrieve the current capitalization mode in effect at the current cursor position in the text.

Usage

From source file:com.anysoftkeyboard.AnySoftKeyboard.java

private void updateShiftStateNow() {
    final InputConnection ic = getCurrentInputConnection();
    EditorInfo ei = getCurrentInputEditorInfo();
    final int caps;
    if (mAutoCap && ic != null && ei != null && ei.inputType != EditorInfo.TYPE_NULL) {
        caps = ic.getCursorCapsMode(ei.inputType);
    } else {//from  w ww . j  av  a2s.co  m
        caps = 0;
    }
    final boolean inputSaysCaps = caps != 0;
    Logger.d(TAG, "shift updateShiftStateNow inputSaysCaps=%s", inputSaysCaps);
    mShiftKeyState.setActiveState(inputSaysCaps);
    handleShift();
}

From source file:org.distantshoresmedia.keyboard.LatinIME.java

private int getCursorCapsMode(InputConnection ic, EditorInfo attr) {
    int caps = 0;
    EditorInfo ei = getCurrentInputEditorInfo();
    if (mAutoCapActive && ei != null && ei.inputType != EditorInfo.TYPE_NULL) {
        caps = ic.getCursorCapsMode(attr.inputType);
    }//  www .  jav  a2 s. c om
    return caps;
}