[dolphin] [Bug 465489] Can no longer unassign "space" from activating selection mode
Felix Ernst
bugzilla_noreply at kde.org
Fri Feb 10 14:44:51 GMT 2023
https://bugs.kde.org/show_bug.cgi?id=465489
--- Comment #3 from Felix Ernst <felixernst at kde.org> ---
Yea, after thinking some more about it, I have to say that it would of course
generally be an improvement long-term if the Space key could be mapped to other
actions. If/when a QuickLook feature would be implemented, users that got used
to selection mode on Space would be just as disrupted by the sudden change as
you are now by changing it to selection mode.
I doesn't/didn't seem high priority to me because the old functionality on
Space couldn't really be changed either.
I'll now explain a way I see how this could potentially be implemented. Maybe
someone is interested in picking this up.
The biggest issue for what happens by default on Space is that the Space key
needs to be usable for example by blind people to press down the currently
focused button. If we were to simply bind the Space key to an action, pressing
Space could no longer be used for anything else
(https://bugs.kde.org/show_bug.cgi?id=458281), including Dolphin's type-ahead
feature (https://bugs.kde.org/show_bug.cgi?id=458282).
So when an action were to be bound to Space by a user, we need to disable it in
certain situations so it doesn't interfere with other functionality. The way to
disable a keyboard shortcut in certain situations is QAction::shortcutContext
(https://doc.qt.io/qt-5/qaction.html#shortcutContext-prop). Unfortunately AFAIK
this can't simply be used in our case with our frameworks.
So instead we use QAction::shortcutContext to completely disable all keyboard
shortcuts for the action that got assigned to the Space key. To make the
shortcut still work, we will need to trigger the action ourselves when the
Space key is pressed in the correct context. We do this by telling the view
controller that that action is what is supposed to be triggered when the Space
key is pressed while the view has focus.
Then everything would be mostly working! Except if that action also has another
non-Space keyboard shortcut. We can either let users know that that one doesn't
work while Space is also assigned, or we install an eventFilter on the whole
application to listen for that other shortcut.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the kfm-devel
mailing list