Results 1 to 4 of 4

Thread: Input to inactive application

  1. #1
    Join Date
    Jun 2010
    Posts
    97
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanked 2 Times in 2 Posts

    Default Input to inactive application

    Hi,

    I have my application minimized in system tray and focus is not on that application.
    I want to pass some string when particular key is pressed.
    Key press is handled in my application but is not able to get notification in my application during inactive state once key is pressed.
    Please help me out.

    Regards

    Manish

  2. #2
    Join Date
    Oct 2011
    Location
    Germany
    Posts
    27
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanked 2 Times in 2 Posts

    Default Re: Input to inactive application

    If you develop for Windows, you can implement a keyboard hook, which calls a specific function of your choice.
    The hook is a callback function and must be implemented in a DLL.
    This link explains how:
    http://www.codeproject.com/Articles/1264/KeyBoard-Hooks
    Insanity: doing the same thing over and over again and expecting different results.
    Albert Einstein

  3. #3
    Join Date
    Jun 2010
    Posts
    97
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanked 2 Times in 2 Posts

    Default Re: Input to inactive application

    Thanks ObiWanKenobe.

    Let me give a try on this.


    Regards

    Manish

  4. #4
    Join Date
    Jun 2012
    Location
    Iran , Tehran
    Posts
    93
    Platforms
    Unix/X11 Windows Android
    Thanks
    5

    Default Re: Input to inactive application

    you can use the windows API function: getAsyncKeyState() in windows.h header.
    and you also use QKeyEvent class.
    Life is about making the right decisions and moving on.

Similar Threads

  1. Application Lost Focus / Inactive / In Background
    By javed_alam786 in forum Qt Programming
    Replies: 3
    Last Post: 10th May 2011, 10:12
  2. Application Lost Focus / Inactive / In Background
    By javed_alam786 in forum Newbie
    Replies: 2
    Last Post: 10th May 2011, 10:08
  3. application that is not hidden when inactive
    By afflictedd2 in forum Qt Programming
    Replies: 2
    Last Post: 8th January 2011, 17:23
  4. Core Application - Input/Output
    By Peppy in forum Qt Programming
    Replies: 4
    Last Post: 19th May 2010, 11:47
  5. My SDI application freezes when it is inactive ...why ?
    By yellowmat in forum Qt Programming
    Replies: 1
    Last Post: 5th September 2006, 16:37

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
  •  
Qt is a trademark of The Qt Company.