Results 1 to 2 of 2

Thread: How to realize the hotKey function?

  1. #1
    Join Date
    Mar 2009
    Location
    Nanjing,China
    Posts
    40
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default How to realize the hotKey function?

    I have an application with Qt3 run in Win32 and Unix.
    And now I want my applicatoin support the hotkey function.
    the function like those:
    when the function is minimumed,I can define the hotkey like "Ctrl+1" to maximized it!
    when the function lose the focuse,I can define the hotKey like "Ctrl+2" to display the front.

    for my application run in Win32 and Unix,so I want this function all support in this two platform.

    and in Win32,I use the SetWindowsHookEx API to realsize my function,but I don't know how to realize it in Unix.

    also,in Qt3,weather has the function?like QAccell or other?

  2. #2
    Join Date
    Feb 2008
    Posts
    98
    Thanks
    2
    Thanked 24 Times in 24 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to realize the hotKey function?

    You can use XGrabKey(). The Psi IM client has a GlobalShortcutManager class that does the trick. You may take a look at it. The Qxt library also has global shortcuts using QxtGlobalShortcut. Both are for Qt 4 but you can take a look at it to make your own implementaion.

Similar Threads

  1. QPSQL problem
    By LoneWolf in forum Installation and Deployment
    Replies: 60
    Last Post: 4th November 2009, 14:22
  2. Regading Driver to connect Postgresql Database
    By dummystories in forum Installation and Deployment
    Replies: 38
    Last Post: 12th March 2009, 07:19
  3. QPSQL driver in windows
    By brevleq in forum Installation and Deployment
    Replies: 31
    Last Post: 14th December 2007, 12:57
  4. how to add static library into qmake
    By Namrata in forum Qt Tools
    Replies: 1
    Last Post: 20th November 2007, 17:33
  5. use qpsql
    By raphaelf in forum Installation and Deployment
    Replies: 34
    Last Post: 22nd August 2006, 12:52

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.