|
|||||||
| Qt Programming General Qt programming issues. |
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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? |
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
The message can be caught via QWidget::winEvent().
__________________
J-P Nurmi |
|
#4
|
|||
|
|||
|
Thank you for your answers. I got it to work with QWidget::winEvent().
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|