60

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 '10 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. – Jeremy Kerr Feb 17 '11 at 3:02
  • pwr.github.io/Solaar this is the solution – user2167582 Nov 2 '16 at 17:17
106

This is described on the Ubuntu Community Wiki:

https://help.ubuntu.com/community/AppleKeyboard#Change%20Function%20Key%20behavior

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
6
  • 9
    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. – Gabriel Staples Mar 20 '17 at 19:55
  • can confirm that it works on MacBook Air 2015 with 16.04 on it – Ege Sucu Mar 28 '18 at 6:47
  • 1
    can confirm that it works on MacBook Pro 2015 with 19.04 on it – Kun Ren Apr 20 '19 at 5:16
  • 2
    worked with Ubuntu 18.04 and the Apple numeric pad wired keyboard – dcalap Mar 17 '20 at 8:22
  • 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 Tavora Jan 10 at 19:04
2

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. – CloudMeta Oct 17 '10 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 '20 at 11:53

Not the answer you're looking for? Browse other questions tagged or ask your own question.