Important: Please read the Qt Code of Conduct -

WM_LBUTTONDOWN no produce QMouseEvent after last Windows 10 update

  • 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:


    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.

  • Lifetime Qt Champion

    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 ?

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

  • 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

  • Lifetime Qt Champion

    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.

  • 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
        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?

Log in to reply