On Fri, Oct 21, 2011 at 10:02 PM, Olivier Goffart <[email protected]> wrote:
> On Friday 21 October 2011 19:50:33 Mark wrote: > > On Tue, Oct 18, 2011 at 8:33 PM, Mark <[email protected]> wrote: > > > 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. > > This was discussed before, and the problem is that one would want a > framework > to register the global shortcut into a central place on the system that > handle > conflicts in shortcut and proper configuration. > KDE has such a thing, i don't know about the other systems. > > > > > > > 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? > > Not really. > Qt application need to work on all the platform and window manager. > > > > But how am i supposed to do that? Where is lighthouse even hidden? > > > And what happened to QtCore? Is that now QtBase? > > Lighthouse is the codename for QPA. That is, the windowing system > abstraction > layer and its plugins. > The abstraction layer is in QtGui (all the files with _qpa), the plugins > are > in src/plugins/platforms > > Considering global shortcut is part of that, i guess you need to add some > interface in the abstraction layer, and then a specific implementation for > each platform in the plugins. > Note that this would only be the "client" code. > > I don't get what you mean here.. Don't you just mean QShortcut? > > The server side framework to handle the registration or the conflicts is > outside of the scope of Qt. > > > > > So where do i get started with this? > > Checkout the code, open the editor :-) > > > > And I've never build Qt 5 yet nor did i ever contribute actual code to > > > it.. so that's gonna be interesting. > > Everything has a begining :-) > > > But you should definitively look at previous implemntations (such as the > one > in qxt). And in particular how the kde infrastructure works, because it > would > be nice if it was integrated into it. > > That said, being perfect the first time is not possible. > I'm kinda confused and don't know if i get you or not :p Are you suggesting to: - have a client app (the one KDE has for defining global key shortcuts) - have the Qt app (the app itself so i guess you can call this "server") to "define" which keys can be set as global keys..? Am i interpreting it correctly? Right now i make a todo application and i want a new window to pop up when i press the CTRL + ALT + T combination (that stands for creating a new task in my app). And i really just want to do that in pure Qt and that app only, not by having a client - server model like described above.. On the other hand, if Linux, Windows and Mac all had some app like KDE's global shortcut manager then i would certainly like to use it. But that's not the case for at least Windows. KDE has it, don't know for mac. Regards, Mark
_______________________________________________ Qt5-feedback mailing list [email protected] http://lists.qt.nokia.com/mailman/listinfo/qt5-feedback
