131

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.

Kevin Bowen
  • 19,615
  • 55
  • 79
  • 83
oscar
  • 1,321
  • 5
    This could be an option in your bios. – roeland Nov 12 '17 at 05:40
  • 2
    Should 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) – Frank N May 13 '21 at 10:42

13 Answers13

296

For some computer models, to toggle F1 .. F12 keys use media functions or to be the "F" keys press Fn + Esc .

Quasímodo
  • 2,017
Andrew
  • 3,087
80

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

Zanna
  • 70,465
zardosht
  • 1,151
  • 9
  • 9
26

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.

Byte Commander
  • 107,489
23

Press Fn+Fn Lock. It will toggle between Enable and Disable.

Eliah Kagan
  • 117,780
16

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.

wjandrea
  • 14,236
  • 4
  • 48
  • 98
  • 1
    With 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. – MathKid Jul 07 '19 at 13:03
6

On HP probook 450, left shift has fn lock, so fn+leftShift locks it.

Zanna
  • 70,465
5

Press Fn+Num Lock to disable it.

zx485
  • 2,426
Qu3d45
  • 59
2

Look in the BIOS. For Acer laptop I can choose the toggle on Fn touch in it.

Eliah Kagan
  • 117,780
TikTaZ
  • 131
1

In addition to zardosht answer above as I cannot comment yet.

echo 2 | sudo tee /sys/module/hid_apple/parameters/fnmode

To make this work after reboots I followed Zanna's link to add in sysfutils Ubuntu 17.04 Macbook Pro Tilde key Fix

Added this in the last line to end of file

module/hid_apple/parameters/fnmode = 2

save, reboot and should be working.

Thanks!

John Cosio
  • 11
  • 3
  • Thank 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! – Kalizi Jan 30 '22 at 09:21
  • This 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.

    – Alterlife May 06 '22 at 10:37
1

Ubuntu 20.04
From BIOS (if fn + Esc is not work)

  • Go to the Bios
  • Navigate to the Main tab
  • Look for the Function Key Behaviour setting and set Function Key instead of the Media Key option.
johirpro
  • 111
0

On some Keyboard, the left shift is the fn lock key. Press fn+left shift to toggle

0

On microsoft keyboard with trackpad:

[Fn-Caps]

Joao Polo
  • 101
0

On Huawei laptops, press fn key once. This will toggle the behaviour. On some models, the "disabled" behaviour will be indicated with a LED light on.

myrs
  • 291