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

Item Keys events not received

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.7.1
    • None
    • tested on Windows 11 with Chrome 124.0.6367.201 and Edge 124.0.2478.67, touchscreen
    • WebAssembly

    Description

      Items Keys event are not received until Tab key is pressed 2 times.

      Then Keys events are received.

      Here is a simple QML code to reproduce

      // code placeholder
      import QtQuick
      import QtQuick.Window
      
      Window {
          width: 640
          height: 480
          visible: true
          title: qsTr("Hello World")    Rectangle {
              id: redRect
              color: focus ? "green": "red"
              width: 640
              height: 480        focus: true        Text {
                  id: text
                  text: ''
                  height: 30
              }        Keys.onPressed: (event) => {
                                  text.text = 'Key pressed';
                                  console.log('key pressed',event.key,event.nativeScanCode);
                              }
              Keys.onReleased: (event) => {
                                   text.text = 'Key releasecd';
                                   console.log('key released',event.key,event.nativeScanCode);
                               }
          }
      } 

      Attachments

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

        Activity

          People

            lpotter Lorn Potter
            remy67 remy rouvin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There is 1 open Gerrit change