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

When keyboard shortcut is used on MacOS, keystroke is repeated N times randomly, instead of once only


    • Platform/s:


      Our application is using custom defined keyboard shortcuts, for various QMenu items, using this code:


      I am not sure if this applies for shortcuts defined via QtCreator's window designer as well, but it definitely does for these that we configured using above mentioned code snippet. The bug is simply that upon press of selected shortcut (single keystroke on keyboard) the related event / action function associated with it is called random amount of times, typically 1 - 4 times instead of once only. Just like if the key was pressed multiple times instead of once.

      We created a workaround for this which is basically gathering the QDateTime::currentDateTime() everytime when key is pressed and compares with previously stored value and if the timespan is lower than 100ms the keypress is ignored.

      The application is shipped for Windows and Linux as well, and this bug is only affecting MacOS.

      To reproduce:

      One of affected applications is this one, it's open source: https://github.com/huggle/huggle3-qt-lx

      To reproduce bug, you can either compile it, following instructions here: https://github.com/huggle/huggle3-qt-lx/wiki/Building-on-MacOS

      Or download precompiled package: https://github.com/huggle/huggle3-qt-lx/releases/download/3.4.4/huggle_3.4.4.dmg

      To be able to track this bug within application, it's necessary to start it in verbose mode (parameter -v), you can bypass the login process simply by putting "Developer Mode" as login name (legacy login) and hitting enter.

      In MainWindow of application, using any user defined shortcut will probably trigger the bug.


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



            • Assignee:
              srutledg Shawn Rutledge
              petrb Petr Bena
            • Votes:
              0 Vote for this issue
              3 Start watching this issue


              • Created:

                Gerrit Reviews

                There are no open Gerrit changes