Search in sources :

Example 16 with InputEvent

use of android.view.InputEvent in project android_frameworks_base by ParanoidAndroid.

the class InputMethodManager method sendInputEventOnMainLooperLocked.

// Must be called on the main looper
int sendInputEventOnMainLooperLocked(PendingEvent p) {
    if (mCurChannel != null) {
        if (mCurSender == null) {
            mCurSender = new ImeInputEventSender(mCurChannel, mH.getLooper());
        }
        final InputEvent event = p.mEvent;
        final int seq = event.getSequenceNumber();
        if (mCurSender.sendInputEvent(seq, event)) {
            mPendingEvents.put(seq, p);
            Trace.traceCounter(Trace.TRACE_TAG_INPUT, PENDING_EVENT_COUNTER, mPendingEvents.size());
            Message msg = mH.obtainMessage(MSG_TIMEOUT_INPUT_EVENT, p);
            msg.setAsynchronous(true);
            mH.sendMessageDelayed(msg, INPUT_METHOD_NOT_RESPONDING_TIMEOUT);
            return DISPATCH_IN_PROGRESS;
        }
        Log.w(TAG, "Unable to send input event to IME: " + mCurId + " dropping: " + event);
    }
    return DISPATCH_NOT_HANDLED;
}
Also used : Message(android.os.Message) InputEvent(android.view.InputEvent)

Example 17 with InputEvent

use of android.view.InputEvent in project platform_frameworks_base by android.

the class TvView method dispatchKeyEvent.

@Override
public boolean dispatchKeyEvent(KeyEvent event) {
    if (super.dispatchKeyEvent(event)) {
        return true;
    }
    if (DEBUG)
        Log.d(TAG, "dispatchKeyEvent(" + event + ")");
    if (mSession == null) {
        return false;
    }
    InputEvent copiedEvent = event.copy();
    int ret = mSession.dispatchInputEvent(copiedEvent, copiedEvent, mFinishedInputEventCallback, mHandler);
    return ret != Session.DISPATCH_NOT_HANDLED;
}
Also used : InputEvent(android.view.InputEvent)

Example 18 with InputEvent

use of android.view.InputEvent in project platform_frameworks_base by android.

the class TvView method dispatchTrackballEvent.

@Override
public boolean dispatchTrackballEvent(MotionEvent event) {
    if (super.dispatchTrackballEvent(event)) {
        return true;
    }
    if (DEBUG)
        Log.d(TAG, "dispatchTrackballEvent(" + event + ")");
    if (mSession == null) {
        return false;
    }
    InputEvent copiedEvent = event.copy();
    int ret = mSession.dispatchInputEvent(copiedEvent, copiedEvent, mFinishedInputEventCallback, mHandler);
    return ret != Session.DISPATCH_NOT_HANDLED;
}
Also used : InputEvent(android.view.InputEvent)

Example 19 with InputEvent

use of android.view.InputEvent in project android_frameworks_base by DirtyUnicorns.

the class TvView method dispatchKeyEvent.

@Override
public boolean dispatchKeyEvent(KeyEvent event) {
    if (super.dispatchKeyEvent(event)) {
        return true;
    }
    if (DEBUG)
        Log.d(TAG, "dispatchKeyEvent(" + event + ")");
    if (mSession == null) {
        return false;
    }
    InputEvent copiedEvent = event.copy();
    int ret = mSession.dispatchInputEvent(copiedEvent, copiedEvent, mFinishedInputEventCallback, mHandler);
    return ret != Session.DISPATCH_NOT_HANDLED;
}
Also used : InputEvent(android.view.InputEvent)

Example 20 with InputEvent

use of android.view.InputEvent in project android_frameworks_base by AOSPA.

the class InputMethodManager method sendInputEventOnMainLooperLocked.

// Must be called on the main looper
int sendInputEventOnMainLooperLocked(PendingEvent p) {
    if (mCurChannel != null) {
        if (mCurSender == null) {
            mCurSender = new ImeInputEventSender(mCurChannel, mH.getLooper());
        }
        final InputEvent event = p.mEvent;
        final int seq = event.getSequenceNumber();
        if (mCurSender.sendInputEvent(seq, event)) {
            mPendingEvents.put(seq, p);
            Trace.traceCounter(Trace.TRACE_TAG_INPUT, PENDING_EVENT_COUNTER, mPendingEvents.size());
            Message msg = mH.obtainMessage(MSG_TIMEOUT_INPUT_EVENT, seq, 0, p);
            msg.setAsynchronous(true);
            mH.sendMessageDelayed(msg, INPUT_METHOD_NOT_RESPONDING_TIMEOUT);
            return DISPATCH_IN_PROGRESS;
        }
        Log.w(TAG, "Unable to send input event to IME: " + mCurId + " dropping: " + event);
    }
    return DISPATCH_NOT_HANDLED;
}
Also used : Message(android.os.Message) InputEvent(android.view.InputEvent)

Aggregations

InputEvent (android.view.InputEvent)27 Message (android.os.Message)7 SuppressLint (android.annotation.SuppressLint)1 Activity (android.app.Activity)1 Bitmap (android.graphics.Bitmap)1 Uri (android.net.Uri)1 SslError (android.net.http.SslError)1 FragmentActivity (android.support.v4.app.FragmentActivity)1 KeyEvent (android.view.KeyEvent)1 View (android.view.View)1 ClientCertRequest (android.webkit.ClientCertRequest)1 ConsoleMessage (android.webkit.ConsoleMessage)1 DownloadListener (android.webkit.DownloadListener)1 Callback (android.webkit.GeolocationPermissions.Callback)1 HttpAuthHandler (android.webkit.HttpAuthHandler)1 JsPromptResult (android.webkit.JsPromptResult)1 JsResult (android.webkit.JsResult)1 PermissionRequest (android.webkit.PermissionRequest)1 SslErrorHandler (android.webkit.SslErrorHandler)1 ValueCallback (android.webkit.ValueCallback)1