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

keyPressEvent does not work in Windows 10 for keyboard modifiers

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 5.15.2
    • None
    • Windows 10 Pro 10.0.19041 in a Parallels Virtual Machine on Mac OS Catalina 10.15.7
    • Windows

    Description

      Steps to reproduce: Windows 10, mingw, QtCreator, all out of the box. 
      Take any program and override keyPressEvent. I took addressbook-example, also unmodified except:

      void AddressWidget::keyPressEvent(QKeyEvent *event)
      {.  
          static int x = 0;
        x++;
      }

      Put a breakpoint on x++ and start debugging.

      Press '1' - breakpoint triggers as expected on PRESSING the key DOWN
      Press 'Alt' or 'Ctrl' or any other modifier. Breakpoint triggers when RELEASING the key. This is unexpected.

      The same code works on Mac OS as expected, i.e. under Mac OS the breakpoint is always triggered when pressing a key DOWN.

      Note: It has nothing to do with the debugger, release code also misbehaves in Windows.

      Attachments

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

        Activity

          People

            srutledg Shawn Rutledge
            frodo Jens
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes