Ask Your Question

How to remap keyboard keys in Fedora 27 /w Wayland?

asked 2018-02-27 04:09:44 -0500

schroedingersdog gravatar image

Hi all,

I need to remap the editing block keys ("Insert", "Delete" and "Home"). I tried the methods that worked for me in the past (see below) but with Fedora 27 and Wayland none of them seem to make an effect at all.

For those who wonder why I want to do that remapping: My Cherry keyboard sports a vertical-aligned editing block (the Ins,Del,Pos1,PgUp,PgDn,End keys group) however in an order which is beyond logic (not to say idiot). So when I got the keyboard some years ago, I pulled off the 3 caps, reordered and snapped them back on, then changed the keyboard layout inside the operating system config (Windows 7, Ubuntu 16.04) back then

In the old days, using udev rules worked fine. With later (Ubuntu) distros I needed to use xmodmap and finally xkb (editing keymaps) to achieve the same. Now on Fedora27 with Wayland, none of the above ways seems to work. I'm not even talking about making changes persist across boot... it's about making the remaps work at all.

As of now, I even desperately tried to use dconf-editor to change org.destkop.gnome (IIRC) keyboard config. Also to no avail. Google'ing for that issue doesn't reveal any "new" advise - and those I found don't work.

Can someone point me to a description of what to do to make key remaps work on Fedora 27? Note that there is also a similar (yet still unanswered) question here:

I'm perfectly fine with a working remap of, let's say, "Ins" keystrokes being recognized as "Delete" and can probably extrapolate the other remaps. ;) Would be nice to have a solution that persists across boot (albeit with the help of login-time scripts if required) and preferrably working in console too. But I'd be glad to be told a way that works at all.

TIA, Cheers, Thomas

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-03-01 09:38:48 -0500

schroedingersdog gravatar image

Hi all,

in reply to myself, here's how I got it working.

Note: This is most probably a dumb, non-elegant, "brute-force" like approach to remap keys that might work just for me. It may not be applicable to YOUR use case and has some drawbacks (see below for details).

After reading this post I went to just edit the contents of /usr/share/X11/xkb/keycodes/evdev.

In that file I looked for the key 'names' and changed the assigned scancodes as per my needs. Actually rather self-explaining. The changes are also persistent across boots / logins.


  • Doesn't work in console
  • Isn't hardware-specific I think (means: It probably is apllied to all attached keyboards)
  • It is not system-wide (means: it is per user. Uhm, probably considered as an advantage by some folks?)
  • Thunderbird seems to not react when pressing delete. Could be caused by something else though.

Anyway, hope it will help someone. Feel free to improve solution/answer by commenting. I'm a noob when it comes to Linux so don't expect this post to be the perfect kinda solution.

Regards, Thomas

edit flag offensive delete link more


This actually worked. Thanks a lot! My shift key is not working so i had to remap it to CTRL or something else.

I had some problems when i tried it for the first time. I swapped the IDs (eg:108) between the keys, and that didn`t do anything. But when i swapped the key names (eg:<ralt>) it worked.

Sorry if i was actually supposed to know that, but i`m a newcomer in this linux community. I hope my post helps other noobs [like me] as well :)).

KemyKo gravatar imageKemyKo ( 2018-03-02 09:40:23 -0500 )edit

Question Tools

1 follower


Asked: 2018-02-27 04:07:27 -0500

Seen: 1,485 times

Last updated: Mar 01 '18