70

To be more clear, right now the volume and brightness keys are used and I have to hold Fn in order to execute an F1, F2, F3, F4, F5... command. Can I reverse this so it's function key by default and holding Fn enables the volume and other special controls?

3
  • Are you looking for a per-user or system-wide setting?
    – ændrük
    Oct 15, 2010 at 17:13
  • Could you specify what sort of keyboard this is; a stand-alone Apple USB keyboard, or something built into a laptop? This will help others with the same question find it more easily. Feb 17, 2011 at 3:02
  • pwr.github.io/Solaar this is the solution Nov 2, 2016 at 17:17

4 Answers 4

135

This is described on the Ubuntu Community Wiki:

https://help.ubuntu.com/community/AppleKeyboard#Change_Function_Key_behavior

You can try:

sudo bash -c "echo 2 > /sys/module/hid_apple/parameters/fnmode"

If it works you can change this permanently (per the linked wiki page):

echo options hid_apple fnmode=2 | sudo tee -a /etc/modprobe.d/hid_apple.conf
sudo update-initramfs -u -k all
sudo reboot # optional
7
  • 11
    That link you posted is quite a lot to read. To help future users get to the permanent solution (that doesn't get undone after each reboot) faster, here's the 3 commands you need to type to make this permanent, per the link you posted above: 1) echo options hid_apple fnmode=2 | sudo tee -a /etc/modprobe.d/hid_apple.conf, 2) sudo update-initramfs -u -k all, 3) (optional) sudo reboot. Done! Works for me on my 2008 white MacBook running Xubuntu 16.04 LTS. Mar 20, 2017 at 19:55
  • can confirm that it works on MacBook Air 2015 with 16.04 on it
    – Ege Sucu
    Mar 28, 2018 at 6:47
  • 1
    can confirm that it works on MacBook Pro 2015 with 19.04 on it
    – Kun Ren
    Apr 20, 2019 at 5:16
  • 3
    worked with Ubuntu 18.04 and the Apple numeric pad wired keyboard
    – dcalap
    Mar 17, 2020 at 8:22
  • 1
    Not only does this work with Apple keyboards, but also apparently any keyboard that uses the same controller, such as the Varmilo VA87M: forums.servethehome.com/index.php?threads/…
    – joao
    Jan 10, 2021 at 19:04
4

please try this when editing directly fnmode fails.

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

0

On older Apple laptop hardware, this is accomplished by a configuration setting of PBButtonsd. You would need to add this line to the config file /etc/pbbuttonsd.conf:

KBDMode = fkeysfirst  

PBButtonsd works on iBooks and PowerBooks (PowerPC-based) and MacBooks (Intel-based); the native Ubuntu package seems to have disappeared after Dapper Drake

1
  • Actually I'm running a Thinkpad T510, I just love these aluminum Apple keyboards.
    – MetaGuru
    Oct 17, 2010 at 2:36
0

it may also be worthwhile to check your BIOS options for this feature. On my Dell Inspiron, this can be set through the BIOS. Hopefully it'll work for your hardware too.

1
  • As far as I know, there is no way to access to the BIOS for Mac. This is Apple approach
    – sangorys
    Dec 22, 2020 at 11:53

Not the answer you're looking for? Browse other questions tagged .