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. Paste text system wide

Paste text system wide

Scheduled Pinned Locked Moved Unsolved General and Desktop
qclipboardsendinput
3 Posts 2 Posters 670 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.
  • H Offline
    H Offline
    hackspider
    wrote on last edited by
    #1

    Hello,

    A sender (tablet, raspberry pi, etc.) sends a text string via tcp sockets to the host application which runs mainly in the tray in the background.

    When the host application receives such a text string it shall be pasted the text string at the current (system wide) cursor position.

    My first idea was to utilize Clipboard for this task but the "Notes for Universal Windows Platform Users" that only active applications with window focus can access the clipboard will prevent the usage of the Clipboard.

    Next idea was to utilize the windows SendInput method to send char by char via keyboard input. But with different keyboard layouts and unicode support this is not a stable and universal solution.

    My question is: Do you guys can give me a hint where to search next to solve this problem?

    Best regards
    hackspider

    JonBJ 1 Reply Last reply
    0
    • H hackspider

      Hello,

      A sender (tablet, raspberry pi, etc.) sends a text string via tcp sockets to the host application which runs mainly in the tray in the background.

      When the host application receives such a text string it shall be pasted the text string at the current (system wide) cursor position.

      My first idea was to utilize Clipboard for this task but the "Notes for Universal Windows Platform Users" that only active applications with window focus can access the clipboard will prevent the usage of the Clipboard.

      Next idea was to utilize the windows SendInput method to send char by char via keyboard input. But with different keyboard layouts and unicode support this is not a stable and universal solution.

      My question is: Do you guys can give me a hint where to search next to solve this problem?

      Best regards
      hackspider

      JonBJ Online
      JonBJ Online
      JonB
      wrote on last edited by
      #2

      @hackspider said in Paste text system wide:

      the current (system wide) cursor position

      What's that?

      only active applications with window focus can access the clipboard

      Isn't that your definition of "the current (system wide) cursor position" ?

      1 Reply Last reply
      1
      • H Offline
        H Offline
        hackspider
        wrote on last edited by
        #3

        Hello,

        "the current (system wide) cursor position" is for example in word or in another a text chat or wherever the user currently sets focus pasteable text field.

        "only active applications with window focus can access the clipboard" no this is the restriction from QClipboard to access the windows clipboard. My host program runs in the background in the tray and therefore does not have the window focus and cannot access the windows clipboard properly.

        Best regards
        hackspider

        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