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. Receiving clicks without focus
Forum Updated to NodeBB v4.3 + New Features

Receiving clicks without focus

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

    Question: Is it possible in Qt to respond to click events on buttons without moving focus onto the application window?

    Context: I am working on a generic on-screen keyboard for Wayland based window managers in Linux. It is easily to register a virtual input device using Linux's /dev/uinput interface, but the problem is that clicking on a button in the UI moves focus onto the keyboard application's window. This means the key event is routed to the keyboard application instead of the application I am trying to type into.

    Thank you!

    1 Reply Last reply
    0
    • jeremy_kJ Offline
      jeremy_kJ Offline
      jeremy_k
      wrote on last edited by
      #2

      I was under the impression that transferring focus was entirely up to the compositor. A quick search turned up discussion around on screen keyboards that aren't implemented within the compositor. These threads are a few years old, and don't have a useful answer.

      The signal QWaylandSeat::mouseFocusChange() has arguments for the new and previous holder. QWaylandSeat::setKeyboardFocus() appears to allow transferring keyboard focus. Together they would appear to give an OSK the ability to direct key input to the target window. I have no experience with either.

      Asking a question about code? http://eel.is/iso-c++/testcase/

      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