Mark
2011-10-18 18:33:57 UTC
Hi,
I want to adjust QShortcut to use it for global shortcuts as well and would
like to lay out my idea on how i intend to do that. Any feedback on it would
be more then welcome.
The first thing to do is add an enum value to Qt::ShortcutContext
http://doc.qt.nokia.com/latest/qt.html#ShortcutContext-enum:
Qt::SystemShortcut (that becomes value 5) with the description: "The
shortcut is active in a system wide context when the application is
running."
Next up is probably (being optimistic here) tweaking the eventFilter of the
QShortcut class to act on global shortcuts for Windows, Linux and MAC when
the Qt::SystemShortcut enum is set.
Now some questions pop up. It has been said that (global) shortcuts should
probably be handled through the window manager. In Qt's case that means (?)
through LightHouse right?
But how am i supposed to do that? Where is lighthouse even hidden?
And what happened to QtCore? Is that now QtBase?
So where do i get started with this?
And I've never build Qt 5 yet nor did i ever contribute actual code to it..
so that's gonna be interesting.
A lot of questions ;)
Thanx in favor,
Mark
I want to adjust QShortcut to use it for global shortcuts as well and would
like to lay out my idea on how i intend to do that. Any feedback on it would
be more then welcome.
The first thing to do is add an enum value to Qt::ShortcutContext
http://doc.qt.nokia.com/latest/qt.html#ShortcutContext-enum:
Qt::SystemShortcut (that becomes value 5) with the description: "The
shortcut is active in a system wide context when the application is
running."
Next up is probably (being optimistic here) tweaking the eventFilter of the
QShortcut class to act on global shortcuts for Windows, Linux and MAC when
the Qt::SystemShortcut enum is set.
Now some questions pop up. It has been said that (global) shortcuts should
probably be handled through the window manager. In Qt's case that means (?)
through LightHouse right?
But how am i supposed to do that? Where is lighthouse even hidden?
And what happened to QtCore? Is that now QtBase?
So where do i get started with this?
And I've never build Qt 5 yet nor did i ever contribute actual code to it..
so that's gonna be interesting.
A lot of questions ;)
Thanx in favor,
Mark