Multikey shortcuts in kde 4.1 where officially supported. But the implementation wasn't what most of us expected. KKeySequenceWidget - responsibly for capturing key sequence from the user - had some annoying bugs.
KKeySequenceWidget is this small widget most of you will know. With kde 4.1 it had some shortcomings. The developer / code was able to use shortcuts like "ctrl-r, ctrl-t" or "ctrl-r, shift-t. The user was unable to assign these because KKeySequenceWidget couldn't handle them.
When capturing shortcuts it only allowed pressing one or more modifiers and then sequentially some keys. If one modifier was released the capturing stopped immediately. A modifier is one of shift, meta, alt or ctrl. Even if you had to hold down the modifier(s) all the time during the capturing, the resulting shortcut only had the modifier(s) on the first key. After for example pressing ctrl-r, ctrl-s while capturing, the resulting shortcut was ctrl-r, s. So you had to release ctrl before pressing s. It was not possible to switch modifier during the capturing.
With kde 4.2 the capturing goes on as long as a modifier is pressed. If the last modifier is released a timer starts. if the user presses a key before the timer ends the key is added to the sequence and the timer restarts. If the user presses a modifier before the timer ends the timer is stopped again and the capturing goes on.
With that scheme it's possible to record the weirdest shortcuts. Go ahead and assign "ctrl-r, meta-s, k, alt-s".
I would like to have some feedback on the usability and intuitiveness of capturing key sequences. Currently the timer isn't visualized. I think it should. Anyone else an opinion?
The maximum number of keys is currently hard coded as 4. With KKeySequenceWidget::setMultiKeyShortcutsAllowed() it's possible to only allow one key shortcuts. This is needed for global shortcuts because it's not possible to have multikey global shortcuts currently.
But before you get to creative with your shortcuts keep the ambiguity problem in mind. I will talk about this problem in one of my next posts. But in short. It's not possible to have both "ctrl-a" and "ctrl-a, shift-s" at the same time. KShortcutsEditor knows that and will warn you.
Mike
Comments
Use "clear" button?
Oh, *thank you* for this. I
Oh, *thank you* for this.
feedback
Great! But it still doesn't work for me in input actions kcm
Thank you for doing this, it's really more usable and easier to use than before in 4.1. But note that it still doesn't work in input actions kcm. I can assign multikey shortcut (e.g. ctrl+q, shift+b), but when I press apply it automatically switches to only first one (ctrl+q) and triggers on it.
Also, in 3.5 there was a nice popup which would appear when using multikey shortcuts, for example:
______________________
Alt+Space,... |
Maximize Window X |
Minimize Window Y |
Hide Border C |
[...] |
______________________|
Great! But it still doesn't work for me in input actions kcm.
The input actions kcm's shortcuts are global shortcuts. That means they can only be one key shortcuts. With Lubos resurrecting the kde 3.5 version of that kcm i'm not sure which version you use. With kde 4.2 my version for input actions will be delivered. You can't record multikey shortcuts there.
I'm thought about something like that popup for kde 4.2. The problem is in kde 3.x we did the complete shortcut handling in kde code. With qt 4.0 that logic was incorporated into qt. kde4 now uses the qt code. But now we do not have all information needed to supply that popup. And my communication with Trolltech/Nokia regarding bugs/features in that code leads me to the conclusion that situation won't get better anytime soon.
Meta
"Meta" is a pain in the ass. I've looked it up, but I forgot again what it was... the right Alt key, wasn't it? Anyways, there is no key on my keyboard that says "Meta", and when any of my not-so-technically-inclined friends reads "Meta-[whatever]" in the shortcuts dialog, I bet my morning muesli that neither of them knows what's meant by that.
Could it be somehow possible to replace Meta by whatever key it is actually assigned to? Or at least show some inline help in the shortcuts dialog that tells me what Meta is all about? Imho, that would be usability enhancement #1.
Meta
The translation is provided by Qt. That's where meta comes from. And i don't know enough about the underlying X-Code to say if it is possible to improve it.
Double key presses
Sweet
Multiple global shortcuts?
Multiple global shortcuts?
Not yet. But it would be a rather trivial fix.
Post new comment