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

QKeyEvent::isAutoRepeat sometimes wrongly false in keyReleaseEvent

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • 5.12.0 Alpha
    • 5.5.1, 5.8.0 Beta
    • QPA: X11/XCB
    • None
    • ubuntu 16.04 with qt 5.5.1, also verified with 5.8.0
    • 21f976f4f0f79b1c4c77a402ebed88d8afb3d9e1

    Description

      This relates to ubuntu 16.04:
      When pressing down a key and holding it, keyReleaseEvent sometimes wrongly reports isAutoRepeat as false. This has been reported infrequently by others (QTBUG-20387, https://forum.qt.io/topic/68803/problem-with-qkeyevent-isautorepeat-function, http://stackoverflow.com/questions/38102221/qkeyevent-isautorepeat-not-working#38122074).
      To track it down, I messed with the event-lookahead for keypress in qtbase/src/plugins/platforms/xcb/qxcbkeyboard.cpp:1525. After adding a short usleep, allowing the outstanding generated events to arrive made the problem completely go away:

             // look ahead for auto-repeat
              KeyChecker checker(source->xcb_window(), code, time, state);
              usleep (500); // On my (old and outworn slow laptop (Intel® Celeron(R) CPU N2830 @ 2.16GHz × 2)):100: very rarely sometimes false key-releases 200: ok.
              xcb_generic_event_t *event = connection()->checkEvent(checker);
      

      So maybe it would be helpful to add such a usleep

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-57335
          # Subject Branch Project Status CR V

          Activity

            People

              liaqi Liang Qi
              pbhd0815 Peter Bauer
              Veli-Pekka Heinonen Veli-Pekka Heinonen
              Votes:
              2 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes