Ubuntu 16.04 doesn't recognize Fn key
Andrew Mclaughlin
I've installed Ubuntu 16.04 and everything works great except that it doesn't recognize my keyboard layout properly.
When I click on keyboard layout chart Fn key doesn't appear there.
Also, shortcuts like Alt + F4 don't work. I have to hold Fn + Alt + F4 to work.
22 Answers
As it won't.
Fn does not appear on keyboard layouts because as far as the operating system is concerned, it does not exist.
The Fn key is handled entirely by the microprocessor in the keyboard. Knowledge of it is not sent over the wire. There's no USB HID "usage" denoting it. It has no PS/2 scancode.
The keyboard's microprocessor uses the current Fn shift state (incorporating any "Fn lock" or latch) to determine the usages/scancodes that are sent over the wire for other keys, including the keys that double-up as both function keys and (say) multimedia keys. This is why you needed to press Fn+F4 to actually get F4 sent over the wire.
(In a number of modern keyboard microprocessors, there are four maps from physical keys to usages/scancodes, one for each of the four combinations of current Fn shift state and NumLock LED (sic!) state.)
For some keyboards with Fn keys, the manufacturer also provides a vendor-private USB output mechanism for setting the sense of the Fn shift state. This mechanism is what your firmware's SETUP utility is invoking, and what utilities like the Lenovo Keyboard "Driver" invoke on Windows. Outwith this, though, operating systems and applications have no knowledge of Fn.
Further reading
- Jonathan de Boyne Pollard (2020). The "Fn" key is local.. Frequently Given Answers.
You can usually set this in the BIOS / Set-up utility. For example, my Dell 1558 has two modes:
The function keys control the media / brightness / system features directly, and if you want to use them as function keys, you have to press Fn + Fxx.
The "Normal" way where the function keys act as function keys, and you have to press Fn + Fxx to access the media / brigntess features.
This is not related to Ubuntu specifically, but also applies if you're using Windows.
1