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. How to Simulate A KeyBoard typing on Operation System...
Forum Update on Tuesday, May 27th 2025

How to Simulate A KeyBoard typing on Operation System...

Scheduled Pinned Locked Moved General and Desktop
4 Posts 4 Posters 2.7k 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.
  • D Offline
    D Offline
    dcbasso
    wrote on last edited by
    #1

    Hello all!!
    I'm thinking to make a app to simulate a keyboard typing...
    It's not really complicated, I just want to send a keyboard type to Operational System... Something like, type UP, DOWN, LEFT, RIGHT, Volume +, Volume -, ESC... some commands...
    I would like to control my PC from another PC... just using the keyboard and nothing else... How can I do that? Any kind of Qt Api, or any lib to make that?

    Thanks

    1 Reply Last reply
    0
    • 8 Offline
      8 Offline
      8majkel8
      wrote on last edited by
      #2

      It's system related question. On windows you can use BroadcastSystemMessage ( http://msdn.microsoft.com/en-us/library/windows/desktop/ms644932(v=vs.85).aspx ). Look in Windows API reference for more information.

      1 Reply Last reply
      0
      • Chris KawaC Offline
        Chris KawaC Offline
        Chris Kawa
        Lifetime Qt Champion
        wrote on last edited by
        #3

        For Windows there's also a little easier function "SendInput":http://msdn.microsoft.com/en-us/library/windows/desktop/ms646310.aspx
        The benefit of it is that it simulates the actual input instead of sending the resulting messages to applications. It's easier cause there's no need to handle all possible messages involved in keyboard interaction(there can be a lot in certain scenarios), which are taken care of by the OS.

        As for the rest of the app it's a classic server/client situation. One PC is running a server and listens for commands from a client (in this case key strokes) and then executes them. There are "Fortune client/server Qt examples":http://qt-project.org/doc/qt-5.0/qtnetwork/examples-network.html showing how to do that.

        1 Reply Last reply
        0
        • A Offline
          A Offline
          ashleydaniel
          Banned
          wrote on last edited by
          #4
          This post is deleted!
          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