Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Catch android menu key in qml?
QtWS25 Last Chance

Catch android menu key in qml?

Scheduled Pinned Locked Moved Solved Mobile and Embedded
2 Posts 2 Posters 609 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mr Pang
    wrote on last edited by
    #1

    Keys.onPressed {
    console.warn(event.key);
    }

    print nothing when I click menu key.

    D 1 Reply Last reply
    0
    • M Mr Pang

      Keys.onPressed {
      console.warn(event.key);
      }

      print nothing when I click menu key.

      D Offline
      D Offline
      Devopia53
      wrote on last edited by
      #2

      @Mr-Pang

      Your QML item should always have a focus otherwise you will get no key events.

      For example, in QML you would do something like this:

      Rectangle {
      focus: true
      anchors.fill: parent
      [...]
      Keys.onPressed: {
      console.log("Keys.onPressed!")
      event.accepted = true
      }
      }

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved