Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. BUG: keyReleaseEvent does not fire if focus changed to child widget
Forum Updated to NodeBB v4.3 + New Features

BUG: keyReleaseEvent does not fire if focus changed to child widget

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 2 Posters 485 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.
  • I Offline
    I Offline
    ieprov
    wrote on last edited by ieprov
    #1

    here is video
    https://dump.video/i/JkNLyYhO.mp4

    i am catching global window keys and pressing a key.
    Then I switch focus to child widget, and as you can see window no longer receives key release event.

    With this bug I cannot create a custom shortcut implementation

    jsulmJ 1 Reply Last reply
    0
    • I ieprov

      here is video
      https://dump.video/i/JkNLyYhO.mp4

      i am catching global window keys and pressing a key.
      Then I switch focus to child widget, and as you can see window no longer receives key release event.

      With this bug I cannot create a custom shortcut implementation

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @ieprov said in BUG: keyReleaseEvent does not fire if focus changed to child widget:

      i am catching global window keys

      How exactly? Please show the code.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      I 1 Reply Last reply
      0
      • jsulmJ jsulm

        @ieprov said in BUG: keyReleaseEvent does not fire if focus changed to child widget:

        i am catching global window keys

        How exactly? Please show the code.

        I Offline
        I Offline
        ieprov
        wrote on last edited by
        #3

        @jsulm overriding of virtual event() method of top widget (aka window)

        jsulmJ 1 Reply Last reply
        0
        • I ieprov

          @jsulm overriding of virtual event() method of top widget (aka window)

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @ieprov I think for your use case you need to install an event filter. See https://doc.qt.io/qt-6/eventsandfilters.html

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • I Offline
            I Offline
            ieprov
            wrote on last edited by
            #5

            @jsulm nope. Event filter filters event before passing it to .event()
            but as you can see in the video there is NO key release event at all, only key press.

            1 Reply Last reply
            0
            • I Offline
              I Offline
              ieprov
              wrote on last edited by
              #6
              This post is deleted!
              1 Reply Last reply
              0
              • I Offline
                I Offline
                ieprov
                wrote on last edited by ieprov
                #7

                installEventFilter on window handle (QWindow) do not receive events when I clicked to MenuBar.

                but events exist in QApplication.notify()

                it seems like if keyPressed and then QWindow was changed to opened QMenu, no keyRelease was emiited to previous QWindow.

                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