F9 display switch is broken on non-QWERTY layouts

The “display switch”/“project” (F9 fn) key is meant to emit Win+P, the default shortcut for display switching in Windows and common Linux distributions. However, what actually happens is that the firmware emits Win+<the scancode for the physical key position that maps to P on QWERTY layouts>. If a non-QWERTY layout is configured in the OS, a completely different shortcut may end up being emitted, leading to incorrect behavior for the key. (For example, I get Win+Y with my Colemak layout.)

This erroneous behavior is defined in the EC firmware here. I believe the solution to this bug is to change the behavior of the key in firmware to emit an event corresponding to what Linux calls KEY_SWITCHVIDEOMODE. But perhaps that would cause issues on the Windows side? I don’t know what the proper fix is there.

See also What's up with the display switch key?

1 Like

Welcome to the forum.

Honestly, the Display key feels appropriately set.
Anyone who changes their layout to something different from the actual keyboard might need to change the shortcut settings in their OS, or modify the EC firmware to match their new layout. You might be using Colemak layout, but Framework does not offer a Colemak keyboard, so the keyboard you’re using of course wasn’t made for Colemak.

Framework could send KEY_SWITCHVIDEOMODE instead of Win+P, but as you say, that may cause a problem on windows. And windows is dominate. If there is one that need to accommodate / adapt, it’s the less dominate OS. And I say that as a Linux user. Who hasn’t used windows in ages, has zero love for windows.

Framework offers several blank keyboards meant for use with any layout. The keyboards differ only in ISO vs ANSI and in what is printed on the keycaps; the issue is with the EC firmware, not the keyboard.


Also, this is not a Linux-specific issue. Setting a custom keyboard layout on a Windows installation exposes this problem also.

It remains that windows seemingly expects / defaults to Win+P for the Display shortcut.

The keyboard has to pick something to send, and it’s going to send what will work for the largest number of people. Keyboards don’t send actual letters, they send keycodes, it’s the OS that interprets / converts it to a letter. When you change your layout, you’re telling the OS to interpret the keycodes differently. And you then might need to change your shortcut, because the shortcuts are processed at a higher level, not by keycode. But since you are making changes already, is it really a problem? And in the end, it seems unavoidable anyway.

~edit~
Nah, that wrong. Not unavoidable. Framework could add a function into the Firmware to push a different key to ‘Display’ (without reflashing firmware). There is already a function to update the keymap, but it seems that it doesn’t extend to separating F-keys from their alt functions. E.g. you can remap F1 to F9, but the alt function comes along with the F#.

Having done more research, it seems this could be either of:

PR to embedded controller: Add option to emit HID display toggle from F9 display key by Jules-Bertholet · Pull Request #49 · FrameworkComputer/EmbeddedController · GitHub