@Override
  public boolean onTouchEvent(@NonNull MotionEvent me) {
    if (getMiniKeyboard() != null && mMiniKeyboardPopup.isShowing()) {
      final int miniKeyboardX = (int) me.getX();
      final int miniKeyboardY = (int) me.getY();
      final int action = MotionEventCompat.getActionMasked(me);

      MotionEvent translated =
          generateMiniKeyboardMotionEvent(action, miniKeyboardX, miniKeyboardY, me.getEventTime());
      getMiniKeyboard().onTouchEvent(translated);
      translated.recycle();
      return true;
    }

    return super.onTouchEvent(me);
  }
@Test
  public void testLongPressWithPopupDoesNotOutputPrimaryCode() throws Exception {
    final Keyboard.Key key = findKey('w');

    Point keyPoint = ViewTestUtils.getKeyCenterPoint(key);
    ViewTestUtils.navigateFromTo(mViewUnderTest, keyPoint, keyPoint, 400, true, false);
    TestRxSchedulers.foregroundAdvanceBy(1);
    Assert.assertTrue(mViewUnderTest.mMiniKeyboardPopup.isShowing());
    Mockito.verify(mMockKeyboardListener, Mockito.never())
        .onKey(
            Mockito.anyInt(),
            Mockito.any(Keyboard.Key.class),
            Mockito.anyInt(),
            Mockito.any(int[].class),
            Mockito.anyBoolean());

    mViewUnderTest.onTouchEvent(
        MotionEvent.obtain(
            SystemClock.uptimeMillis(),
            SystemClock.uptimeMillis(),
            MotionEvent.ACTION_UP,
            keyPoint.x,
            keyPoint.y,
            0));

    Assert.assertFalse(mViewUnderTest.mMiniKeyboardPopup.isShowing());
    // not sure about this. Maybe the output should be the first key in the popup
    // FIXME: suppose to be '2' and not code 969 (omega)
    Mockito.verify(mMockKeyboardListener)
        .onKey(eq(969), Mockito.any(Keyboard.Key.class), eq(0), Mockito.any(int[].class), eq(true));
    Mockito.verify(mMockKeyboardListener, Mockito.never())
        .onKey(
            eq((int) 'w'),
            Mockito.any(Keyboard.Key.class),
            Mockito.anyInt(),
            Mockito.any(int[].class),
            Mockito.anyBoolean());
  }