2

I am using Arch Linux with KDE Plasma 5.27 and the Wayland compositor.

On my laptop, I am able to use the key combination Fn + ArrowDown to mean PageDown. Similarly I can combine Fn with the other arrow keys to mean Home, End and PageUp.

I recently switched from my laptop to a desktop computer. I don't have an Fn key there, but I really like this combination for quick navigation. I would like to implement this key combination using the Windows/Meta key instead of Fn. How can I implement this mapping?

Currently Meta + an arrow key moves the active window around. I don't really care about this behavior, but I would still need to disable it.

The closest question I could find was this one, but it's an old question for X.org. I use Wayland.

1 Answer 1

2

It doesn't matter whether you use Xorg or Wayland, in KDE you can configure shortcuts the same way either way. Edit: As pointed out by a comment, since version 5.25, Custom Shortcuts are no longer available in KDE + Wayland.

KDE has built-in shortcut configuration tools. "Shortcuts" for pre-defined functions specified by your installed apps and "Custom Shortcuts". You can access them by using the systemsettings kcm_keys command.

In the "Shortcuts" menu, scroll down to "KWin" and select it. On the right you get a list of window manager shortcuts. For me, the relevant key combos are set for "Quick Tile Window to the Left" and so on. You can clear those now, but they are automatically cleared if you use them for something else.

Since you want to remap the keys to a different keyboard input, you'll have to use the "Custom Shortcuts" tool, so click on that in the left panel. Here you have a list of your custom shortcuts and an "Edit" menu button at the bottom. Click that button, and then select "New" -> "Global Shortcut" -> "Send Keyboard Input".

In the "Trigger" tab for the new shortcut, you can assign your key combo. If you haven't cleared it before, it will ask you whether you want to reassign it, so click "Reassign".

enter image description here

In the "Action" tab, you can define a keyboard input combo in the text field at the top. For simultaneous input, connect key names with +, for sequential input, connect them with :. The correct names are listed here, from line 393 onwards, in quotation marks near the end of each line: https://github.com/qt/qtbase/blob/f89c4c4f8fd5afbb6a5480fe2fc13bb6dcaace47/src/gui/kernel/qkeysequence.cpp#L393

For the inputs you want, use these codes (obviously you have to make a separate shortcut for each):

  • PgDown
  • PgUp
  • Home
  • End

enter image description here

In the "Window" section, simply leave "Active window" selected. Click "Apply" to save your changes. You can also add a description and a name for each shortcut, or create a "group" in the list of custom shortcuts to keep them organized.

6
  • 1
    Thank you for your great answer and screenshots. It is very helpful. I found how to edit the KWin shortcuts. However, I only have a "Shortcuts" tab, bot "Custom Shortcuts" as on your screens. I may be missing some package or have a different KDE Plasma version. Here is what I see: i.imgur.com/d41Rwac.png
    – Demurgos
    Commented Jan 19 at 15:55
  • 1
    I found a thread mentioning the missing "Custom Shorcuts" tab: bbs.archlinux.org/viewtopic.php?id=277837. Apparently it's disabled on Wayland. And here is the relevant issue: bugs.kde.org/show_bug.cgi?id=455444
    – Demurgos
    Commented Jan 19 at 16:09
  • Ah, I see. I thought I had used it before on Wayland but that must have been on an earlier version.
    – sonofevil
    Commented Jan 19 at 16:20
  • 1
    I'm currently reading the discussion and linked alternatives in the KDE bugs thread. Looks like required changes for Wayland support will land in Plasma 6.1 (or later). So for now my question is not solved; but I'll still upvote your answer as it's helpful. I'll revisit this question/answer in the future.
    – Demurgos
    Commented Jan 19 at 16:29
  • 1
    I tried wtype but encounter this issue. I think I'll just have to wait a bit until the situation improves :(
    – Demurgos
    Commented Jan 19 at 21:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .