Strange default configuration for F13 - F24 keys

I know this isn’t exactly the right place to ask this, but I couldn’t find anywhere more appropriate, so here goes. Please feel free to point me in the right direction if you know a better forum for this.

The Manjaro KDE installation of xkeyboard-config does some really weird stuff with the F13-F24 keys, which I don’t think makes much sense at all. For example, in my /usr/share/X11/xkb/symbols/inet, I have lines like this:

    key <FK13>   {      [ XF86Tools         ]       };
    key <FK14>   {      [ XF86Launch5       ]       };
    key <FK15>   {      [ XF86Launch6       ]       };
    key <FK16>   {      [ XF86Launch7       ]       };
    key <FK17>   {      [ XF86Launch8       ]       };
    key <FK18>   {      [ XF86Launch9       ]       };

So, for example, pressing F13 brings up the KDE settings application because it’s bound to XF86Tools for some reason. Now I’m sure this all made sense to somebody at some point, but it strikes me as defaults that are at best surprising and at worst downright bizarre. Why not just have F13-F24 be F13-F24?

I can configure these to be sensible for any given user by creating ~/.Xmodmap with lines

keycode 191 = F13 F13 F13
keycode 192 = F14 F14 F14
keycode 193 = F15 F15 F15
keycode 194 = F16 F16 F16
keycode 195 = F17 F17 F17
keycode 196 = F18 F18 F18
keycode 197 = F19 F19 F19
keycode 198 = F20 F20 F20
keycode 199 = F21 F21 F21
keycode 200 = F22 F22 F22
keycode 202 = F23 F23 F23
keycode 203 = F24 F24 F24

But wouldn’t it be better if Manjaro’s default config just didn’t mess with these keys unnecessarily? It’s a really user-unfriendly thing to have to work out how to fix stuff like this. I get that the current default is probably inherited from upstream, but I’m starting here because I can’t imagine getting very far on the X11 mailing lists.


Context:
For those who don’t know, the F13-F24 keys are really useful for setting custom shortcuts, precisely because they don’t physically exist on most keyboards, but they’re still valid keys that programs will accept as shortcuts. For example, My mouse has a bunch of extra buttons and the manufacturer’s windows software allows me to configure the firmware to send F13-F24 keys for each of these buttons, which means I can configure these as for places where keyboard shortcuts are accepted, but mouse button shortcuts aren’t (often in games, for example). People often use F13-F24 with custom keyboard firmwares for similar reasons.

2 Likes

Almost every laptop in production and many multimedia keyboards map those functions - if it does suit you - then thats great - and you have also solved your issue.

What more can you ask?

You are probably correct - the defaults are defined how they are because the majority uses them - that why.

And if Manjaro where to change them - many users would complain about missing functionality.

Tradeoff - and you are the first person to ever mention this all the years I have spent on the Manjaro forum - so I reckon you are very alone on this.

Ok, so what I’m hearing is that it is (was at some point in the past?) common for keyboards to have dedicated keys for “settings”, “launch app 1”, etc., and these were typically (?) sending F13-F24 keystrokes and just assuming the OS would interpret these correctly? This would give some explanation as to why X11 has these weird defaults.

This seems… unlikely to me that this behaviour was that common. In particular, it doesn’t make sense to me how Windows, for example, will happily just accept F13-F24 without mapping them onto surprising behaviours.

I guess my main concerns are:

  1. This is a pretty painful thing to work out how to work around. A “normal” user would likely just say “linux is dumb” and get frustrated.
  2. Yes, media keys are very common on keyboard (volume, start, stop, play, etc. being probably the most common) but they don’t appear to work by sending F13-F24 for most common uses? Why do we have defaults that are catering to what must be a very very small number of keyboards with strange ways of sending niche commands (when was the last time I saw a keyboard with a “settings” key? I certainly wouldn’t expect it to work OOTB on anything modern if I did see one)

Edit: about half of my reason for making this post was to let people find it when searching “F13 on manjaro opens settings” etc. Precisely because it’s a bit of a pain to figure out how to work around.

2 Likes

This was my understanding as well … I thought the most common way we got things like media keys was from deinfitions like ‘MUTE’ and various 'I…'s like ‘I2E’

These actually seem, at least in my file, to be under ‘evdev standards’ … but I also agree that they are a bit odd, and verge on useless. According to the docs all those ‘launch’ ones are as entirely cryptic as they appear - they ‘launch application’. what exactly, I do not know … and I would guess it is actually nothing.

( XF86keysym.h - xorg/proto/x11proto - X.org X11Proto protocol headers. (mirrored from https://gitlab.freedesktop.org/xorg/proto/xproto) )

1 Like

No - I don’t think that is what I am saying.

There is a lot of popular bulk produced consumer keyboards with keys for sound, multimedia etc.

Most laptops has dual function keys for screen brightness, sound etc.

evdev is the default on Manjaro and maybe the defaults are less desirable - but I can assure you those defaults are not defined by Manjaro - but as you say - defined upstream - they may be utilised - but the underlying keypress for e.g. xf-functionality is defined by - I don’t know who.

I think this approach is - at least partly - driven by the masses demanding Windows like functionality - but that is purely speculative.

I landed here wondering why F13 opens settings app. I bought a macro pad and configured it F13-F24 and wow, I don’t like those keys being predefined.
Exactly as OP stated, I am now a new Linux frustrated user that doesn’t know how to fix it.
I don’t know which majority would be using these keys because the majority doesn’t know they exist.
What do laptop Fn keys have to do with this? Some manufacturer bound F keys instead correct keys?
“Windows like functionality”??? I haven’t seen a keyboard younger than 40 years having these keys.

2 Likes

Same problem here. I wanted to use F13-F24 with my programmable keyboard but I found out those hardcoded behaviors like you did. It seems that F13 to F19 are safe to use. The rest is mapped to settings, microphone mute, touchpad control and other odd things. I don’t get exactly why it is so. So for example the microphone mute function key of my laptop emmits the keycode 198, which is mapped to X86AudioMute. And my programmable keyboard, trying to trigger a F13 event, also produces keycode 198. The question is, is there a convention of which keycodes should keyboards send to trigger higher F-keys and laptop functions, and why do they overlap?

You are very narrow minded on this.

Your requirements are very specific and as such it will require you to modify the default configuration to suit your needs.

Complaining on the defaults is something a spoiled brat would do while a responsible person will realise having a special requirement is not an argument for changing the defaults to match 10 out of a million users.

The scan codes emitted for the multimedia is is a de-facto standard used by every keyboard vendor in world. Having a programmable keyboard is fine - but don’t complain on something which cannot be changed.

I seems that it was not clear for everyone here the history of those higher F-keys. I had the same surprise seeing that keys mostly unknown to exist, F-13 to F-24, are hard-binded to laptop function key symbols. I also thought at first to use them too with my programmable keyboard. It took some time experimenting and searching forums to get that laptop keyboards have used keycodes previously used for F-keys to implement other functionality. This information is hard to find clearly explained in one single place. Not so much being about spoiled/responsible person.

I agree with OP on this. I was trying to map my new mouse’s thumb buttons to F13 through F24 and it kept not registering, opening KDE settings, and other nonsense. There should be no hidden configuration that remaps F13 through F24 in a root-only text file. If there is a configuration mapping those, it should be accessible in a GUI, easy to find, and have sane defaults (like not remapping all those keys).

If particular laptops have those keys labelled that way, it should be up to those laptops’ vendors to correct their hardware to send the correct scancodes. If there is a workaround built into the OS, that workaround should involve detecting whether the affected hardware is present. In my case, the affected hardware is not present, so the workaround should not be applied, and F13 through F24 should function as expected, without being tainted by hardware I don’t use.