RFC: API and code changes to KShortcut and KAction
ahartmetz at gmail.com
Fri Nov 24 19:03:17 GMT 2006
>Anyway, It could be usefull to keep this ability, which could be
usefull, specially in the future. Example, when mapping multimedia
keys, or infra-red device keys.
Agreed. My problem with the list was that the behavior of KShortcut
becomes harder to understand if you can play around with the internal
list. Also, you won't be able to convince everybody not to abuse the
list for things it was not intended for. People did this in some
existing code. Maybe more triggers _with names_ could be added to
KShortcut like "infraRedTrigger" or "auxTrigger(s)". That would make
it explicit and allow for more sensible handling of these triggers. If
I think about it, maybe these triggers should be added to directly to
KAction. Not sure.
You can still _read_ a list using KShortcut::getList() but you can't
write to a shortcut using list semantics.
Btw, remove() has list-like behavior because it moves alternate to
primary if you'd end up with an empty primary shortcut and a nonempty
alternate. I don't really know if this is good or bad :/
>It's true that KHotkeys is pretty difficult to use, and i'm sure that
people doesn't use mouse gesture because of that.
>I would even add voice trigger to this, but this will require an
integration with KHotkey daemon.
I hate KHotkey because IMHO you should not have to think at all to set
up some additional triggers for an action. KHotkeys tries hard to make
it as difficult as possible. And, frankly, Lubos' code in KHotkeys
makes me go "wtf?". I don't mean to offend anyone but please... I just
can't work with it.
Voice triggers, however, should probably rely on some some global
"daemon" to keep resource usage low (think of connections to the sound
>Anyway, since mouse gesture is now in Qt (right?) that can be done more easily.
Mouse gestures are not in in Qt AFAIK but one of the trolltech guys
has coded a reusable gesture recognition "package" that I might use.
Maybe I am going to use it, maybe not. In any case, my version of
gesture recognition can be swapped out easily if it isn't good enough.
I'll be happy with whatever works best.
>I encourage you to continue :-)
Will do =)
2006/11/24, Olivier Goffart <ogoffart at kde.org>:
> Le vendredi 24 novembre 2006 05:36, Andreas Hartmetz a écrit :
> > Hi!
> > After getting confused by KShortcut, KAction and their documentation
> > that leaves many semantic things unclear, I went ahead and improved
> > them.
> > -KShortcut gets a "primary" and an "alternate" shortcut instead of a
> > list of arbitrary length that was being used in bizarre ways and
> > actually never with more than two shortcuts.
> This is basically not used because the interface doesn't let you configure
> more than two shortcut.
> Anyway, It could be usefull to keep this ability, which could be usefull,
> specially in the future.
> Example, when mapping multimedia keys, or infra-red device keys
> > [...]
> Others change looks nice.
> > Diff anyone? Unfortunately it will be very large. I am pretty sure
> > that nobody would find problems at a glance so it would only be useful
> > to someone who knows the code in question and is willing to invest
> > some time. It compiles and Works For Me(TM)...
> Ok, we trust you :-)
> > In the future I plant to add mouse gesture support to KAction. I have
> > working prototype; the most important issue is how to configure mouse
> > gestures in the shortcut configuration dialog. I need input from the
> > usability people there.
> Cool !
> I wanted to do the same already. My idea was to integrate KHotkeys with
> Anyway, since mouse gesture is now in Qt (right?) that can be done more
> My plans was to do it this way:
> - I would add a column in the configure shortcut dialog with an icon for
> mouse gesture if there is a mouse gesture. Maybe show a graph in a preview
> widget, and add a button to change it.
> - In the menu, add a small icon next to the shortcut, in order to remember
> the user there is a mouse gesture.
> - right click on the menu would allow to configure shortcut or directly set
> gesture. (I even already started to code this item)
> It's true that KHotkeys is pretty difficult to use, and i'm sure that people
> doesn't use mouse gesture because of that.
> I would even add voice trigger to this, but this will require an integration
> with KHotkey daemon.
> I encourage you to continue :-)
More information about the kde-core-devel