[KRunner] Allow modifying the keyboard shortcuts.
Needs ReviewPublic

Authored by smithjd on Aug 11 2018, 5:41 AM.

Details

Reviewers
ngraham
Group Reviewers
Plasma
Summary

Replace event handling with QML Shortcuts and KActionCollection/QAction.

KCM: https://phabricator.kde.org/D15341

Diff Detail

Repository
R120 Plasma Workspace
Branch
master-krunnerbashkeybindings (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 12181
Build 12199: arc lint + arc unit
smithjd created this revision.Aug 11 2018, 5:41 AM
Restricted Application added a project: Plasma. · View Herald TranscriptAug 11 2018, 5:41 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
smithjd requested review of this revision.Aug 11 2018, 5:41 AM

Ctrl+A is reserved for "Select All"

smithjd updated this revision to Diff 39467.Aug 11 2018, 5:45 PM
  • [KRunner] Change start of line shortcut to CTRL + S.
smithjd edited the summary of this revision. (Show Details)Aug 11 2018, 5:45 PM
smithjd edited the test plan for this revision. (Show Details)
smithjd edited the summary of this revision. (Show Details)
smithjd edited the test plan for this revision. (Show Details)
smithjd edited the summary of this revision. (Show Details)

Can you explain the rationale behind this? Since you've seemingly randomly changed the shortcut, it doesn't seem like a "common" shortcut sheme?

I tend to frequenty hit additional keys while not watching the runner window. Although the shortcut is no longer in common with Bash (the CTRL + S shortcut would also have made more sense for Bash) the idea is the same. You can already do this from the keyboard, but it requires a select all keycombo AND an arrow key each time you need to jump forward or backwards.

I now see that KDE has default application shortcuts for beginning of line and end of line (HOME and END) and skip word forwards or backwards (CTRL + RARROW/LARROW), that also work in KRunner, that should obsolete this patch.

I don't understand. Also, you can change the default shortcut from Home/End to whatever you like.

Yes, except the CTRL + S combo is default for save in other applications, with no easy way I can think of to reassign it for just KRunner.

You can't and I don't see why you can't just use Home/End. Sorry.

ngraham requested changes to this revision.Aug 11 2018, 7:23 PM
ngraham added a subscriber: ngraham.

Sorry, I'm with Kai on this, aspecially because one of the proposed new shortcuts conflicts with an existing shortcut that it's possible to use here.

This revision now requires changes to proceed.Aug 11 2018, 7:23 PM

Most of the keys on that side of the keyboard are already bound globally into combos, so the best solution IMO is to intercept the required keycombos in KRunner instead of having to rearrange the global app keycombos around KRunner. This is what this patch does to implement bash-style cursor jumps in KRunner, though this is not so great on the HIG front as the intercepted combos are both standard application shortcuts, also duplicating the standard application shortcuts for beginning of line / end of line.

We also have

system settings -> shortcuts -> standard shortcuts

These can have alternatives which would work for this. I don't know if these work with QQC2 TextFields, we should fix it if not.

Thanks for kconfig magic you can override them (without a gui) on a per-app basis albeit there's no UI for that.

smithjd added a comment.EditedAug 11 2018, 9:30 PM

We also have

system settings -> shortcuts -> standard shortcuts

These can have alternatives which would work for this. I don't know if these work with QQC2 TextFields, we should fix it if not.

Setting alternatives would require unsetting 2 existing default application shortcuts, leaving CTRL-S and CTRL-E unavailable for default actions for other applications. Setting alternatives works for textFields.

Thanks for kconfig magic you can override them (without a gui) on a per-app basis albeit there's no UI for that.

I can't seem to find any information on this.

Perhaps the intent of this patch could change to adding a KShortcutsDialog to the kcm where the MOVETOSTARTOFLINE and MOVETOENDOFLINE keyboard shortcuts could be reassigned?

smithjd updated this revision to Diff 41182.Sep 7 2018, 9:40 PM
  • [KRunner] Re-work the shortcut handling to allow modifying the shortcuts.
smithjd retitled this revision from [KRunner] Bash-inspired keyboard shortcuts for go to start or end of line. to [KRunner] Allow modifying the keyboard shortcuts..Sep 7 2018, 9:49 PM
smithjd edited the summary of this revision. (Show Details)
smithjd edited the test plan for this revision. (Show Details)
smithjd updated this revision to Diff 58697.May 27 2019, 1:36 AM
  • [KRunner] Change start of line shortcut to CTRL + S.
  • [KRunner] Re-work the shortcut handling to allow modifying the shortcuts.
  • Make edit actions configurable.
  • Follow standard shortcuts nomenclature.
  • Fix clear action.