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

MenuBar always steals keyboard focus when Alt or Esc key pressed

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P4: Low
    • None
    • 5.3.1
    • None
    • Windows 7

    Description

      If there is a MenuBar present, then pressing the Esc key once or the Alt key twice causes the component with keyboard focus to lose the keyboard focus, presumably to the menu bar. The typical behavior on Windows is that pressing Esc does not cause focus to be lost, and that pressing the Alt key only causes the menu to be focused under certain circumstances, i.e., if the left mouse button is held down or the Alt keypress ends up being part of a shortcut key combination not handled by the menu, then the menu should not be focused.

      You can see the incorrect behavior by running the attached QML file. If you click and drag inside the window the application displays the current mouse position and whether the Alt key is currently pressed. If you press and release the Alt key repeatedly while dragging the mouse around, you can see that only the first two presses of the Alt key are registered. After that, you need to click and release the mouse inside of the window to reset the focus. This behavior is relevant to us as we want to change the behavior of clicking and dragging an item with the mouse when the Alt key is pressed.

      Attachments

        Issue Links

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

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              mwabrams Mark Abrams
              Votes:
              3 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes