How can I toggle the Fn (function) key?
Solution 1
As far as I know, the Fn key does not get detected by the OS but modifies your other keys on a firmware level. That means you can neither retrieve nor control the state of the Fn key from Ubuntu.
What you could do instead is to change the keyboard shortcut for increasing/decreasing audio volume to an alternative key combination instead of the Fn-modified special key.
Open System Settings → Keyboard and go to the Shortcuts tab. In the list on the left side, select Sound and Media.
After clicking on an entry in the list on the right side (in your case you want to edit Volume up and Volume down), you can press a combination of keys you want to assign to this shortcut. Esc cancels the editing and ← Backspace disables the shortcut.
Solution 2
For some computer models, to toggle F1 .. F12 keys use media functions or to be the "F" keys press Fn + Esc .
Solution 3
If you have an Apple keyboard and want the function keys to act like F1-F12 by default (disable Fn default behavior) give the following command in terminal:
echo 2 | sudo tee /sys/module/hid_apple/parameters/fnmode
from here: https://help.ubuntu.com/community/AppleKeyboard#Change_Function_Key_behavior
Solution 4
Press Fn+Fn Lock. It will toggle between Enable and Disable.
Solution 5
My laptop has a Fn Lock key which is useful, except when it's been pressed by accident. Then pressing F5 in Firefox doesn't reload the page; it switches off the touch pad. I now know what it is but it had me totally bamboozled having to reboot or logout to get the touch pad back working.
Related videos on Youtube
oscar
Updated on September 18, 2022Comments
-
oscar over 1 year
Is there a way to toggle the Fn key? I'd like to be able to toggle it so I don't have to press Fn+F12 to raise the volume, for example.
I'm running Ubuntu 16.04.1 LTS on an Asus D550C.
-
roeland over 6 yearsThis could be an option in your bios.
-
Frank Nocke about 3 yearsShould be in your BIOS → config → is usually either „F1-F12 as Primary Function: On“ or something like „HotKey Mode“ (change from enabled to disabled or vice versa)
-
-
WinEunuuchs2Unix over 7 yearsGreat tip because you can use one hand.
-
Jithin Pavithran over 6 yearsWorks with some laptops like Lenovo Thinkpad series.
-
Jujhar Singh about 6 yearsWorks great on my Lenovo T460 and Dell XPS 15
-
TheCommoner282 over 5 yearsWorks with Dell Inspirion 5000 series. Thank you Andrey
-
MathKid almost 5 yearsWith the Microsoft Natural Ergonomic Keyboard 4000 this key is called
F lock
and is located on the top row next to F12. Pressing it toggles a green LED at the bottom of the keyboard with an F below it. If the LED is off, the function keys don't work. -
Craig Wilcox almost 5 yearsFn + Esc Works like a charm on my DELL Inspiron 15 ~ Thanks! Not sure what 'media functions' is/means
-
ftassi over 4 yearsit seems not to be working on macbook pro 11,4
-
Eric Dela Cruz over 4 yearsWorks for a MBP 6,1 (2010 17")
-
emi over 4 yearsConfirmed for Kloner Bluetooth Keyboard KTB0025.
-
Liam Baker about 4 yearsThis doesn't work on all laptop brands...
-
Igor Rodriguez about 4 yearsIn the HP Zbook G5 the shortcut is Fn + Shift support.hp.com/us-en/document/c02035108
-
n1k31t4 about 4 yearsWorked on HP laptop with Ubuntu 18.04 using an Apple keyboard.
-
Manikandaraj Srinivasan about 4 yearsThis works on my Dell Latitude. And this should have been the accepted answer IMHO.
-
Ezekiel Victor almost 4 yearsWorked on Ubuntu 18 Ubuntu desktop w/ Apple keyboard
-
Willi Mentzel almost 4 yearsdoesn't work on Dell XPS 9570 and Ubuntu 20.04 LTS :(
-
Vignesh almost 4 yearsThis worked on Dell Vostro series laptop, I was confused what the hell happened doing this reversed the keys back to normal
-
Anton Matosov almost 4 yearsWorked for Ubuntu/PopOS 20.04 and doesn't even require reboot
-
foo almost 4 yearsis "Fn Lock" supposed to be a separate key? If so, where could it be found?
-
aderchox over 3 yearsDoesn't work on my HP laptop Ubuntu 20.04
-
Tiana987642 over 3 yearsWork with feker machinist 01, Ubuntu 18.04, no reboot :)
-
Akshay Alva over 3 years@foo its your Escape(Esc) key, in the top left corner.
-
A. Steenbergen over 3 yearsHow can I make this work across reboots?
-
kumetix over 3 yearsLovely! works on Dell XPS 15, Ubuntu 18.04.5
-
Zanna over 3 years@A.Steenbergen you can probably use
sysfsutils
- see my answer here for an example (for a different setting - adjust as needed). -
Edgar Ramírez Mondragón about 3 yearsWorked on my Dell G7 with Ubuntu 20.04
-
Borislav Gizdov about 3 yearsGreat, worked on ubuntu 20.04 with Keychron K3 keyboard (Mac mode)
-
mwieczorek about 3 yearsTip of the day! I recently bought a new MSI Prestige that swaps the F keys with volume, keyboard backlight, etc. I'm a developer, so I always need the original F key functionality. I wish I could upvote this answer twice.
-
veritas1 almost 3 yearsThanks! Got a new Vamillo (VA88M) keyboard, using with PopOS, and the fact that media controls were the default action was bugging me.
-
王子1986 over 2 yearsworks for manjaro system as well
-
Kakiz over 2 yearsThat was very helpful, i switched from media key to function key at BIOS
-
MRule over 2 yearsDoesn't seem to work on LenovoP50
-
MRule over 2 yearsIn that case, this is the same as /u/Andrew's answer --- and it doesn't work on all systems.
-
Kalizi over 2 yearsThank you, this saved my day! If someone gets here, this will switch the function keys to the default behaviour, keeping multimedia working with FN key!
-
KaKi87 about 2 yearsWorked on Ubuntu 21.10 using a Matias keyboard, thanks.
-
Arpad Horvath about 2 yearsI've just realized that there is a small FnLk written on my Thinkpad X250s Escape button. Easier to find out next time.
-
Admin about 2 yearsWorked like a charm on latest Gnome! First time I see gnome changing my Fn .. unsure why but thanks
-
Admin about 2 yearsThis helped me as well: I have a mechanical keyboard from a chinese manufacturer - Hello Gonass which has an fn key. Works fine on windows but the fn keys don't work on Linux.
echo 2 | sudo tee /sys/module/hid_apple/parameters/fnmode
makes it work again. -
Admin almost 2 yearsBrightness up and down?
-
Admin almost 2 yearsOn HP laptops the fn lock key is the left shift key.