145

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
  • 20,055
  • 57
  • 82
  • 84
oscar
  • 1,561

15 Answers15

320

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

Quasímodo
  • 2,104
Andrew
  • 3,327
89

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
  • 72,312
zardosht
  • 1,241
25

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

Eliah Kagan
  • 119,640
25

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
  • 110,243
17

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,504
rhubarbdog
  • 422
  • 1
  • 4
  • 11
7

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

Zanna
  • 72,312
6

Press Fn+Num Lock to disable it.

zx485
  • 2,865
Qu3d45
  • 69
  • 1
  • 2
3

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

Eliah Kagan
  • 119,640
TikTaZ
  • 141
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!

1

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

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 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
  • 311
0

I have a ThinkPad T480 with a Keychrone K3 and what worked for me was:

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

The default was 3, the 2 option doesn't work, but the 1 is working well.

0
  1. Restart the system and go to UEFI Firmware settings(BIOS)
  2. In the side menu, go to keyboard
  3. Turn on the lock fn and set it to run as traditional method.
  4. That's it.