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

QWidget project cannot receive Android 'Menu' hardware key

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2: Important P2: Important
    • Some future release
    • 5.1.0 , 5.1.1
    • None
    • Ubuntu Linux on X86_64 bit
      Android SDK latest (August 13)
      Android NDK r9
      Qt 5.1.1
      Target is: Android_for_arm_GCC_4_8_Qt_5_1_1

      We need to make our Qt app interact with the Android 'Menu' hardware key. So far we can interact with the 'Back' and 'Search' keys OK. Here is the code that does not work (MainWindow class is derived from QWidget).

      void MainWindow::keyPressEvent(QKeyEvent *ev)
      {
      int key = ev->key();

      if (key == Qt::Key_Menu)

      { label5->setText("Hey you just hit the Menu key"); return; }

      label5->setText(QString("Hey you just hit the (%1) key").arg(key));
      QWidget::keyPressEvent(ev);
      }

      This code will display the Search-key code when pressed, but there is no output at all when the 'Menu' key is pressed.

      Regards,
      Chris

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

            esabraha Eskil Abrahamsen Blomfeldt
            xped Chris Wood
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes