Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

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

    General and Desktop
    4
    4
    2505
    Loading More Posts
    • 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
      dcbasso last edited by

      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 Reply Quote 0
      • 8
        8majkel8 last edited by

        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 Reply Quote 0
        • Chris Kawa
          Chris Kawa Moderators last edited by

          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 Reply Quote 0
          • A
            ashleydaniel Banned last edited by

            This post is deleted!
            1 Reply Last reply Reply Quote 0
            • First post
              Last post