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

[REG 5.11.3->5.12.0] "Multimedia keys" (browser forward/back, volume up/down) generate key events without autorepeat and native keycode information

    XMLWordPrintable

Details

    • Windows
    • b556890a9f7dd45550f0d4e9da981e2f779a943b (qt/qtbase/5.12)

    Description

      Attached is a very simple program that logs the events passed to keyPressEvent and keyReleaseEvent.

      When I hold an ordinary key (A in this case) until it autorepeats, I get

      65 30 0 QKeyEvent(KeyPress, Key_A, text="a")
      65 30 0 QKeyEvent(KeyRelease, Key_A, text="a", autorepeat, count=1)
      65 30 0 QKeyEvent(KeyPress, Key_A, text="a", autorepeat, count=1)

      and then the last two lines repeat as long as I hold it down. I assume this is the intended behavior.

      When I hold the volume up key, I get this in Qt 5.11.2 and 5.11.3:

      0 0 0 QKeyEvent(KeyPress, Key_VolumeUp)
      0 0 0 QKeyEvent(KeyRelease, Key_VolumeUp)
      174 302 16777216 QKeyEvent(KeyPress, Key_VolumeUp)
      0 0 0 QKeyEvent(KeyPress, Key_VolumeUp)
      0 0 0 QKeyEvent(KeyRelease, Key_VolumeUp)
      174 302 16777216 QKeyEvent(KeyRelease, Key_VolumeUp, autorepeat, count=1)
      174 302 16777216 QKeyEvent(KeyPress, Key_VolumeUp, autorepeat, count=1)

      and then the last four lines repeat. The first two events in each repeat always have isAutoRepeat() == false, even when the key is autorepeating, and all of the native*() methods return zero. Also, they are in the wrong order (press then release, while repeats are normally release then press).

      In 5.12.0 and 5.12.1, I just get

      0 0 0 QKeyEvent(KeyPress, Key_VolumeUp)
      0 0 0 QKeyEvent(KeyRelease, Key_VolumeUp)

      on each repeat. In other words, I'm still getting the broken events, but I'm no longer getting the events with correct information.

      The same thing happens with volume down, browser back, and browser forward, which are the only other "modern" keys on my keyboard. It doesn't happen with the context menu key, or any of the traditional PC keys.

      I don't need the native*() information, but I do need to be able to discard auto-repeat events and handle physical press and release events only. I never reported this bug in 5.11 because I was able to work around it by also discarding events with nativeVirtualKey()==0. In 5.12 I no longer see how to work around the missing information.

      Attachments

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

        Activity

          People

            anrocha André De La Rocha (Inactive)
            benrg Ben R
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes