Results 1 to 6 of 6

Thread: [QProcess] Can I simulate keyboard input to external program?

  1. #1
    Join Date
    Jul 2009
    Posts
    10
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default [QProcess] Can I simulate keyboard input to external program?

    Hi guys, I'm trying to write a consol base app (under Win XP) that runs (starts) external program and then presses "Tab", "Tab", "Tab" follow by 4 digits then "Tab" and 8 digits. Is it possible to send data to QProcess in a similar to keyboard input way? Any hints on this?

  2. #2
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: [QProcess] Can I simulate keyboard input to external program?

    i dont think QProcess has that functionality... but you can always use WinAPI... if i remember correctly... its SendMessage or something..

  3. #3
    Join Date
    Jul 2009
    Posts
    10
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: [QProcess] Can I simulate keyboard input to external program?

    So there is no other way then WinApi? Can I use some others Qt's features to do that?

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: [QProcess] Can I simulate keyboard input to external program?

    If you have the sources of both apps under your control, you can of course use any IPC mechanism offered by Qt.
    J-P Nurmi

  5. #5
    Join Date
    Jul 2009
    Posts
    10
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: [QProcess] Can I simulate keyboard input to external program?

    The problem is i don't have source code of application I want to comunicate with. I see taht I must resort to WinApi. Thanks for all your help folks.

  6. #6
    Join Date
    Jun 2008
    Location
    Germany/Belarus/Sweden
    Posts
    53
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: [QProcess] Can I simulate keyboard input to external program?

    use better PostMessage function it is asynchronous.

Similar Threads

  1. External Program Management with Qt
    By rapajic in forum Qt Programming
    Replies: 5
    Last Post: 7th April 2009, 09:52
  2. Q3ScrollView resists to scroll down to the garbage bin
    By sivrisinek in forum Qt Programming
    Replies: 0
    Last Post: 5th February 2009, 17:50
  3. Replies: 16
    Last Post: 23rd May 2008, 10:12
  4. Replies: 19
    Last Post: 21st January 2008, 09:13
  5. QT MySQL
    By sabeeshcs in forum Newbie
    Replies: 6
    Last Post: 12th January 2007, 04:19

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.