Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-38379

Android: No move events from Galaxy Note SPen in widgets app

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.6.0
    • 5.2.0, 5.3.0 Beta1
    • QPA
    • Android 4.3 on Samsung Galaxy Note 3,
      Android 4.2.2 on Samsung Galaxy Note 8.0 (GT-N5110)
    • Android
    • 21a0e3c111b97035a01b6386a4e9ecda2d2febf8 01d78ba86a631386a4d47b7c12d2a359da28f517

    Description

      (Originally reported as second issue in QTBUG-36105.)

      When dragging the pen over the screen, only the press and release events were reported, but no move events. The reason was getAction() in src/android/jar/src/org/qtproject/qt5/android/QtNative.java. For move events it checks whether the last "historical" and the most current position are equal and in this case it sets the move event type to 2. This is translated to a Qt::TouchPointState of Qt::TouchPointStationary in src/plugins/platforms/android/src/androidjniinput.cpp, but this is wrong according to the Android MoveEvent documentation ( http://developer.android.com/reference/android/view/MotionEvent.html ), quoted here:

      Batching

      For efficiency, motion events with ACTION_MOVE may batch together multiple movement samples within a single object. The most current pointer coordinates are available using getX(int) and getY(int). Earlier coordinates within the batch are accessed using getHistoricalX(int, int) and getHistoricalY(int, int). The coordinates are "historical" only insofar as they are older than the current coordinates in the batch; however, they are still distinct from any other coordinates reported in prior motion events. To process all coordinates in the batch in time order, first consume the historical coordinates then consume the current coordinates."

      So there are actually multiple issues here:

      • All of the given coordinates should be processed, including the "historical" ones.
      • Only if this is done can an equality check between successive coordinates be applied. Apparently the Galaxy Note's stylus handling always reports the same coordinate as the last "historical" one and the current coordinate.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              srutledg Shawn Rutledge
              dg0yt Kai Pastor
              Votes:
              3 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes