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. Qt equivalent for SendInput from WinAPI

Qt equivalent for SendInput from WinAPI

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 2.5k 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.
  • C Offline
    C Offline
    cdebel2005
    wrote on 5 Sept 2012, 19:23 last edited by
    #1

    I would like to know if there's something equivalent in QT of the Windows API "SendInput" to put some stuff in keyboard buffer?
    We would like to keep our code as portable as possible.

    As far as i've seen, there's a QKeyEvent and postEvent, but it's used to insert "Inputs" in the QT application only (not globally just like Windows does).

    I would like to be able to send keyboard inputs to the application running on top. Notepad for example.

    Thanks

    1 Reply Last reply
    0
    • R Offline
      R Offline
      rcari
      wrote on 6 Sept 2012, 09:06 last edited by
      #2

      What you are trying to do is platform specific. Within Qt as you said you can post/send QKeyEvent but those can only be handled by Qt. Whenever Qt receives native events from the system, it translates them in those Qt specific events, ensuring portability within Qt. All you have to do to port Qt after that is to properly map the native system events to Qt specifc events.
      What you want to do is the opposite, generate Qt specific events and forward them up to the system. I don't know of any crossplatform way of doing that, and especially not in Qt.

      1 Reply Last reply
      0
      • C Offline
        C Offline
        cdebel2005
        wrote on 6 Sept 2012, 15:06 last edited by
        #3

        Thanks for that answer rcari. That would have been nice if Qt was able to do that. I just wanted to make sure that i didn't missed anything in Qt documentation. I know it's quite extensive and i certainly didn't read the whole documentation.

        1 Reply Last reply
        0

        1/3

        5 Sept 2012, 19:23

        • Login

        • Login or register to search.
        1 out of 3
        • First post
          1/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved