0

Note: This was originally posted on AskUbuntu. However, since it got little traction, I chose to also post it here. I hope you don't mind it much. It's related to X11 anyway, so I think it will not be only applicable to Ubuntu.

As far as I know, Ubuntu's Key Bindings are all exposed on the files inside the /usr/share/X11/xkb/symbols folder. I've sometimes used the pc file to make some changes to some keys. However, I would like to know if there is a best practice on how to override the keys, preferably without overwriting these core files.

For example, is there a way of creating a user keyboard setting that would override the default one (like most good code editors do nowadays, such as VS Code)? It would also be much better if this method used the terminal or saved the settings in a file, so I could easily reproduce it in other machines.

EDIT:

More specifically, right now, in my use case, I'm looking to customize my FN key.

  • 3
    The Fn key is frequently a special case, see for example stackoverflow.com/questions/23495426/… and can not be changed. – icarus Aug 4 at 16:21
  • Ah, I see, more and more I feel like X11 should receive a drastic upgrade: "The X protocol has been at version 11 (hence "X11") since September 1987." – Philippe Fanaro Aug 4 at 17:06
  • 2
    The "upgrade" to X is called "Wayland"; the core X protocol won't get upgraded. But none of this affects your Fn key: The problem with this key is that your hardware doesn't report it normally; instead, it's handled by the Embedded Controller (EC) of your laptop, and each laptop does this differently. And the hardware manufacturers keep the details secret, and don't make drivers for Linux. – dirkt Aug 4 at 17:48
  • Really nasty workaround the manufacturers managed to pull off with the Fn key, wow. Personally, I think that users should be able to put a customized layer on everything the keyboard does... I think I'll move away from my current keyboard, which is one where they swapped the Fn key with the Ctrl key (Apple Style), something incredibly annoying. – Philippe Fanaro Aug 4 at 19:10
  • I have no idea what you're asking. Is this about remapping a key globally or in a specific application? If it's about remapping globally, whatever your question is, it's probably already been answered; search the keyboard-layout tag. If it's about VScode, does that even run on Linux? And if it's about Fn, then as others have already said, software can't help you because it's handled in hardware. – Gilles Aug 4 at 23:08

Your Answer

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

Browse other questions tagged or ask your own question.