0

In KDE5 how can we use the same shortcut but achieve different action on per active application basis?

Example i use F3 in my text editor for find next and i want it to refresh the web page when i am using chrome. This question can be assimilated to, how can i customise chrome/chromium shortcuts in KDE?

0

KDE have a great advanced shortcuts management system, the same global shortcut can not be used for different actions right now BUT filters like Active window or Existing window can be applied to the global shortcuts to limit their actions on per application basis.

The unavailable KDE feature that would permit a per application action for a single global shortcut is a kwin only limitation and thus if an application have its own keyboard shortcut implementation, KDE global shortcuts can then be used with filters to achieve the per app action for the same global shortcut.

The filtering feature can as well be useful to customise the keyboard shortcuts for an application like chromium or other applications that have built-in shortcuts that can not be edited. Without impacting the other non targeted apps...

The example bellow show how to use a commonly used shortcut F3 (usually used for find/find-next action, this is not a global KDE shortcut) to make a refresh page action in chromium (without impacting the F3 search function for other apps):

systemsettings5  >  Shortcuts (under workspace)  >  Custom Shortcuts

Add a new group (this is required to be able to filter on per application basis):

Edit  >  New Group  >  Select the new group  >  Open Condition tab

Add the filter condition for an active windows by clicking

New  >  Active Window

We can then click New... then use browser as a value for the window role (if we are targeting all the browsers)

Now that our group is setup, we need to add a new global shortcut in it, we will be simulating F5 (refresh action) with the button F3.

Select the new group  >  Edit  >  New  >  Global shortcut  >  Send keyboard input

An finally on the trigger tab we would assign F3 and on the action we would write F5... The captures bellow demonstrate the whole process.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.