The Ultimate Qt Community site
Home News Forum Wiki Contest FAQ Links

Go Back   Qt Centre Forum > Qt > Qt Programming

Qt Programming General Qt programming issues.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 22nd February 2007, 18:27
steenvinkel steenvinkel is offline
Beginner
 
Join Date: Feb 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Using RegisterHotKey

I have a simple program with a widget. At startup the widget is not shown.

I want to assign a hotkey ( for instance "ctrl + space" ). So when the user pressses "ctrl + space" the widget is shown.

I know i can register the hotkey with

RegisterHotKey(winId(), 100, MOD_CONTROL, VK_SPACE);

But how do i get and react on the messages windows sends when the user presses "ctrl + space" and should RegisterHotKey(); be place anywhere specific in the code?

Reply With Quote
  #2  
Old 24th February 2007, 17:00
Methedrine Methedrine is offline
Intermediate user
 
Join Date: May 2006
Location: Germany
Qt products used: Qt4
Qt platforms used: Unix/X11, Windows
Posts: 106
Thanks: 2
Thanked 13 Times in 11 Posts
Default Re: Using RegisterHotKey

Sorry, misunderstood your problem, QShortCut won't install system-wide hotkeys

But you could always try to implement your own messageFilter.
__________________
"If you lie to the compiler, it will get its revenge." - Henry Spencer
Reply With Quote
  #3  
Old 24th February 2007, 17:15
jpn jpn is offline
Guru
 
Join Date: Feb 2006
Location: Tampere, Finland
Qt products used: Qt4
Qt platforms used: Unix/X11, Windows
Posts: 5,430
Thanks: 36
Thanked 1,218 Times in 1,167 Posts
Default Re: Using RegisterHotKey

The message can be caught via QWidget::winEvent().
__________________
J-P Nurmi
Reply With Quote
  #4  
Old 25th February 2007, 15:52
steenvinkel steenvinkel is offline
Beginner
 
Join Date: Feb 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: Using RegisterHotKey

Thank you for your answers. I got it to work with QWidget::winEvent().

Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 19:23.

Powered by vBulletin Version 3.7.1 Copyright ©2000 - 2008, Jelsoft Enterprises Ltd., vRewrite 1.5 SEOed URLs completed by Tech Help Forum and Chalo Na.
© 2006–2008 Qt Centre - The Ultimate Qt Community site
Nokia, Qt and their respective logos are trademarks of Nokia Corporation in Finland and/or other countries worldwide.