Search in sources :

Example 21 with Event

use of com.android.inputmethod.event.Event in project android_packages_inputmethods_LatinIME by CyanogenMod.

the class MockKeyboardSwitcher method onCodeInput.

public void onCodeInput(final int code) {
    if (mAutoCapsMode == MockConstants.CAP_MODE_WORDS) {
        if (Constants.isLetterCode(code)) {
            mAutoCapsState = (code == MockConstants.CODE_AUTO_CAPS_TRIGGER) ? mAutoCapsMode : MockConstants.CAP_MODE_OFF;
        }
    } else {
        mAutoCapsState = mAutoCapsMode;
    }
    final Event event = Event.createSoftwareKeypressEvent(code, /* codePoint */
    code, /* keyCode */
    Constants.NOT_A_COORDINATE, Constants.NOT_A_COORDINATE, false);
    mState.onEvent(event, mAutoCapsState, RecapitalizeStatus.NOT_A_RECAPITALIZE_MODE);
}
Also used : Event(com.android.inputmethod.event.Event)

Aggregations

Event (com.android.inputmethod.event.Event)21 KeyEvent (android.view.KeyEvent)6 InputTransaction (com.android.inputmethod.event.InputTransaction)3 Point (android.graphics.Point)1 SpannableString (android.text.SpannableString)1 Key (com.android.inputmethod.keyboard.Key)1 MainKeyboardView (com.android.inputmethod.keyboard.MainKeyboardView)1 SuggestedWords (com.android.inputmethod.latin.SuggestedWords)1 Nonnull (javax.annotation.Nonnull)1