Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Always listen for Escape key?
Qt 6.11 is out! See what's new in the release blog

Always listen for Escape key?

Scheduled Pinned Locked Moved Solved QML and Qt Quick
3 Posts 2 Posters 1.4k Views 1 Watching
  • 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.
  • R Offline
    R Offline
    robro
    wrote on last edited by robro
    #1

    Hi,

    I have a QML App with several Qt Quick Control 2 elements like buttons, textfields and so on.
    Usually always one of these elements has the focus.

    My goal is that whatever element has active focus loses it whenever escape is pressed and then an item containing several key events gets the focus. So the app could then be controlled by other keys after pressing escape.

    Can this be achieved?
    If yes, how?

    Thanks!

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Use Shortcut QML element: docs. You can register it as global and control what will happen when Escape is pressed.

      (Z(:^

      1 Reply Last reply
      4
      • R Offline
        R Offline
        robro
        wrote on last edited by
        #3

        Thank you very much, it works great!

        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