title: qt Keys.onPressed: don't answer for keyboard
body: <p>I've got a very strange problem when using Keys.onPressed in a qml, there is no error throughout the compiling as well as executing, but it doesn't execute the function within the case after pressing the keyboard, the code is on the beneath. </p>
  
  <p>I've tried to define the same function in the Keys case as in the mousearea case. But only Clicked mousearea can work,so it's not the problem of the function. And I tried another project using Keys.onPressed so neither the problem of the software. My keyboard works well so I can ask the question here. I've no idea at all.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>import QtQuick 2.5
  import QtQuick.Window 2.2
  
  Window {
  visible: true
  width: 360
  height: 560
  title: qsTr("2048")
  
  MainForm {
      id: root
      anchors.fill: parent
  
      property int eN
      property int eM
  
  
      function vidergrille() {
          for(eN = 0; eN &lt; 4; eN++) {
              for(eM = 0; eM &lt; 4; eM++) {
                  egrille.eNums.itemAt(4*eN+eM).eNum = "";
                  egrille.eNums.itemAt(4*eN+eM).color = "white";
              }
          }
      }
      function showgrille() {
          vidergrille();
          for(eN = 0; eN &lt; 4; eN++) {
              for(eM = 0; eM &lt; 4; eM++) {
                  if(vueGrille.lireChiffre(eN,eM)) {
                      egrille.eNums.itemAt(4*eN+eM).eNum = vueGrille.lireChiffre(eN,eM);
                      egrille.eNums.itemAt(4*eN+eM).color = vueGrille.color(eN,eM);
                  }
              }
          }
      }
  
      Keys.onPressed: {
        switch (event.key) {
          case Qt.Key_Up:
              vueGrille.commencer();
              root.showgrille();
            break;
          case Qt.Key_Down:
              vueGrille.mouveBas();
              root.showgrille();
            break;
          case Qt.Key_Left:
              vueGrille.mouveGauche();
              root.showgrille()
            break;
          case Qt.Key_Right:
              vueGrille.mouveDroite();
              root.showgrille()
            break;
          default:
              break;
        }
      }
  
      start {
          onClicked:vueGrille.commencer(),root.showgrille();
      }
  
      back {
          onClicked:vueGrille.mouveHaut(),root.showgrille();
      }
  }
  }
  </code></pre>