Java Code Examples for android.view.InputDevice#SOURCE_CLASS_TRACKBALL

The following examples show how to use android.view.InputDevice#SOURCE_CLASS_TRACKBALL . 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: Instrumentation.java    From AndroidComponentPlugin with Apache License 2.0 3 votes vote down vote up
/**
 * Dispatch a trackball event. Finished at some point after the recipient has
 * returned from its event processing, though it may <em>not</em> have
 * completely finished reacting from the event -- for example, if it needs
 * to update its display as a result, it may still be in the process of
 * doing that.
 * 
 * @param event A motion event describing the trackball action.  (As noted in 
 * {@link MotionEvent#obtain(long, long, int, float, float, int)}, be sure to use 
 * {@link SystemClock#uptimeMillis()} as the timebase.
 */
public void sendTrackballEventSync(MotionEvent event) {
    validateNotAppThread();
    if ((event.getSource() & InputDevice.SOURCE_CLASS_TRACKBALL) == 0) {
        event.setSource(InputDevice.SOURCE_TRACKBALL);
    }
    InputManager.getInstance().injectInputEvent(event,
            InputManager.INJECT_INPUT_EVENT_MODE_WAIT_FOR_FINISH);
}
 
Example 2
Source File: Instrumentation.java    From AndroidComponentPlugin with Apache License 2.0 3 votes vote down vote up
/**
 * Dispatch a trackball event. Finished at some point after the recipient has
 * returned from its event processing, though it may <em>not</em> have
 * completely finished reacting from the event -- for example, if it needs
 * to update its display as a result, it may still be in the process of
 * doing that.
 * 
 * @param event A motion event describing the trackball action.  (As noted in 
 * {@link MotionEvent#obtain(long, long, int, float, float, int)}, be sure to use 
 * {@link SystemClock#uptimeMillis()} as the timebase.
 */
public void sendTrackballEventSync(MotionEvent event) {
    validateNotAppThread();
    if ((event.getSource() & InputDevice.SOURCE_CLASS_TRACKBALL) == 0) {
        event.setSource(InputDevice.SOURCE_TRACKBALL);
    }
    InputManager.getInstance().injectInputEvent(event,
            InputManager.INJECT_INPUT_EVENT_MODE_WAIT_FOR_FINISH);
}
 
Example 3
Source File: Instrumentation.java    From AndroidComponentPlugin with Apache License 2.0 3 votes vote down vote up
/**
 * Dispatch a trackball event. Finished at some point after the recipient has
 * returned from its event processing, though it may <em>not</em> have
 * completely finished reacting from the event -- for example, if it needs
 * to update its display as a result, it may still be in the process of
 * doing that.
 * 
 * @param event A motion event describing the trackball action.  (As noted in 
 * {@link MotionEvent#obtain(long, long, int, float, float, int)}, be sure to use 
 * {@link SystemClock#uptimeMillis()} as the timebase.
 */
public void sendTrackballEventSync(MotionEvent event) {
    validateNotAppThread();
    if ((event.getSource() & InputDevice.SOURCE_CLASS_TRACKBALL) == 0) {
        event.setSource(InputDevice.SOURCE_TRACKBALL);
    }
    InputManager.getInstance().injectInputEvent(event,
            InputManager.INJECT_INPUT_EVENT_MODE_WAIT_FOR_FINISH);
}
 
Example 4
Source File: Instrumentation.java    From android_9.0.0_r45 with Apache License 2.0 3 votes vote down vote up
/**
 * Dispatch a trackball event. Finished at some point after the recipient has
 * returned from its event processing, though it may <em>not</em> have
 * completely finished reacting from the event -- for example, if it needs
 * to update its display as a result, it may still be in the process of
 * doing that.
 * 
 * @param event A motion event describing the trackball action.  (As noted in 
 * {@link MotionEvent#obtain(long, long, int, float, float, int)}, be sure to use 
 * {@link SystemClock#uptimeMillis()} as the timebase.
 */
public void sendTrackballEventSync(MotionEvent event) {
    validateNotAppThread();
    if ((event.getSource() & InputDevice.SOURCE_CLASS_TRACKBALL) == 0) {
        event.setSource(InputDevice.SOURCE_TRACKBALL);
    }
    InputManager.getInstance().injectInputEvent(event,
            InputManager.INJECT_INPUT_EVENT_MODE_WAIT_FOR_FINISH);
}
 
Example 5
Source File: Instrumentation.java    From droidel with Apache License 2.0 3 votes vote down vote up
/**
 * Dispatch a trackball event. Finished at some point after the recipient has
 * returned from its event processing, though it may <em>not</em> have
 * completely finished reacting from the event -- for example, if it needs
 * to update its display as a result, it may still be in the process of
 * doing that.
 * 
 * @param event A motion event describing the trackball action.  (As noted in 
 * {@link MotionEvent#obtain(long, long, int, float, float, int)}, be sure to use 
 * {@link SystemClock#uptimeMillis()} as the timebase.
 */
public void sendTrackballEventSync(MotionEvent event) {
    validateNotAppThread();
    if ((event.getSource() & InputDevice.SOURCE_CLASS_TRACKBALL) == 0) {
        event.setSource(InputDevice.SOURCE_TRACKBALL);
    }
    InputManager.getInstance().injectInputEvent(event,
            InputManager.INJECT_INPUT_EVENT_MODE_WAIT_FOR_FINISH);
}