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

REG: 6.7.0,6.7.1,6.8.0 Keys.onPressed switch statement fails to recognize unmodified key events on Android

    XMLWordPrintable

Details

    • Android
    • 2024wk18FOQtforAndroid, 2024wk26s2FOQtforAndroid, 2024wk38s2FOQtforAndroid, 2024wk28s2FOQtforAndroid, 2024wk30s2FOQtforAndroid, 2024wk32s2FOQtforAndroid, 2024wk34s2FOQtforAndroid, 2024wk36s2FOQtforAndroid

    Description

      On Android, beginning with I believe either "feature freeze" or "release candidate" (for some value of 'freeze' or 'candidate' ) of 6.7.0, and propagating into the actual release, any QML code like the following fails:

              Keys.onPressed: function(event) {
                  switch (event.key) {
                      case Qt.Key_0: digitPressed("0"); break;
                      case Qt.Key_1: digitPressed("1"); break;
                      case Qt.Key_2: digitPressed("2"); break;
                      case Qt.Key_3: digitPressed("3"); break;
                      case Qt.Key_4: digitPressed("4"); break;
                      case Qt.Key_5: digitPressed("5"); break;
                      case Qt.Key_6: digitPressed("6"); break;
                      case Qt.Key_7: digitPressed("7"); break;
                      case Qt.Key_8: digitPressed("8"); break;
                      case Qt.Key_9: digitPressed("9"); break;
                      case Qt.Key_E: digitPressed("e"); break;
                      case Qt.Key_P: digitPressed("π"); break;
                      case Qt.Key_Plus: operatorPressed("+"); break;
                      case Qt.Key_Minus: operatorPressed("-"); break;
                      case Qt.Key_Asterisk: operatorPressed("×"); break;
                      case Qt.Key_Slash: operatorPressed("÷"); break;
                      case Qt.Key_Enter:
                      case Qt.Key_Return: operatorPressed("="); break;
                      case Qt.Key_Comma:
                      case Qt.Key_Period: digitPressed("."); break;
                      case Qt.Key_Backspace: operatorPressed("bs"); break;
                  }
              }

      The above is from the Examples/Qt-6.7.0/demos/calqlatr example.

      In 'calqlatr', after you click a button explicitly to force focus, and then use the keyboard to type, no key events are recognized. Unless you "modify" your keypress by hitting the 'alt' key and typing the desired character. But any unmodified keypress is not recognized on Android.

      Note that the problem seems confined to alphanumeric input. Because cases like below are recognized:

                  case Qt.Key_MediaNext:
                  case Qt.Key_Right: 
                  case Qt.Key_Direction_R:
                  ...
                  case Qt.Key_MediaPrevious:
                  case Qt.Key_Left:
                  case Qt.Key_Direction_L:
      

      For 6.8.0 "dev" release or 6.6.X this behavior is not seen.

      It is a regression in 6.7.0.

      Attachments

        1. edittext.zip
          2 kB
          Konsta Alajärvi

        Issue Links

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

          Activity

            People

              koalajar Konsta Alajärvi
              nielsmayer Niels Mayer
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes