-
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?
-
Re: Using RegisterHotKey
Sorry, misunderstood your problem, QShortCut won't install system-wide hotkeys
But you could always try to implement your own messageFilter.
-
Re: Using RegisterHotKey
The message can be caught via QWidget::winEvent().
-
Re: Using RegisterHotKey
Thank you for your answers. I got it to work with QWidget::winEvent().