Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. WM_LBUTTONDOWN no produce QMouseEvent after last Windows 10 update

WM_LBUTTONDOWN no produce QMouseEvent after last Windows 10 update

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 2 Posters 1.7k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    miguelorenes
    wrote on last edited by
    #1

    Qt Version: 5.9.3
    I am getting a problem after lastest update of Windows 10:
    Version: 1790
    OS Build 16.299.125

    On previous Windows 10 versions, when I use an external pen device I was getting the events on QT layer as QMouseEvent but after this update, I am not getting anything.

    I have been checking by a QAbstractNativeEventFilter and I am receiving the proper messages:

    • WM_LBUTTONDOWN
    • WM_MOUSEMOVE
    • WM_LBUTTONUP

    But, for some reason I have stopped to receive QMouseEvent on Qt Layer.

    This is very critical for my project as I am implementing some special behaviour by GetMessageExtraInfo flags and it is full based on receiving the proper QMouseEvent on Qt layer.

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      Sounds like the update broke something ( that update killed my debugger)
      Since its sounds like Pen device is still in Mouse Mode since
      WM_LBUTTONDOWN are reported, it sounds inside Qt.

      Would it be possible to try with 5.10 ?

      1 Reply Last reply
      0
      • M Offline
        M Offline
        miguelorenes
        wrote on last edited by
        #3

        Checked with Qt_5_10_0_MSVC2015_32 and happen the same.
        Something on this Windows update has broken this.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          miguelorenes
          wrote on last edited by
          #4

          A little more information about this issue, QMouseEvent is not generated when GetMessageExtraInfo() != 0. That is, when trying to extract pen information as described in https://msdn.microsoft.com/en-us/library/windows/desktop/ms703320(v=vs.85).aspx

          1 Reply Last reply
          0
          • mrjjM Offline
            mrjjM Offline
            mrjj
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Hi
            Its just odd if nativeEventfilter can see them that rest of Qt do not.

            I assume you checked if there is no newer driver for the pen device and
            also that it works at it should in a pen enabled app.

            Sorry i have zero idea of what to check.
            Reinstalling Qt also seems pointless as it worked before the update and unless
            it broke something in Qt, it wont help.

            1 Reply Last reply
            0
            • M Offline
              M Offline
              miguelorenes
              wrote on last edited by
              #6

              thanks @mrjj

              On any case I have to get in deep on this.

              I am checking what I am getting on GetMessageExtraInfo() also the code of "QWindowsMouseHandler::translateMouseEvent" and I think my issue is provoked because of this piece of code:

              // Check for events synthesized from touch. Lower byte is touch index, 0 means pen.
                  static const bool passSynthesizedMouseEvents =
                          !(QWindowsIntegration::instance()->options() & QWindowsIntegration::DontPassOsMouseEventsSynthesizedFromTouch);
                  // Check for events synthesized from touch. Lower 7 bits are touch/pen index, bit 8 indicates touch.
                  // However, when tablet support is active, extraInfo is a packet serial number. This is not a problem
                  // since we do not want to ignore mouse events coming from a tablet.
                  // See https://msdn.microsoft.com/en-us/library/windows/desktop/ms703320.aspx
                  const quint64 extraInfo = quint64(GetMessageExtraInfo());
                  if ((extraInfo & signatureMask) == miWpSignature) {
                      if (extraInfo & 0x80) { // Bit 7 indicates touch event, else tablet pen.
                          source = Qt::MouseEventSynthesizedBySystem;
                          if (!passSynthesizedMouseEvents)
                              return false;
                      }
                  }
              

              Values got with GetMessageExtraInfo:

              • Touch: 0xFF51578B
              • Pen: 0xFF515796

              For some reason my pen actions now are interpretated as touch event because "if (extraInfo & 0x80)" is returning true, so, they are discarded.

              I cannot imagine why Windows 10 is changing this with the latest update.

              Could someone give me a little of light on this?

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved