Adams Bros Blog

14Jun/098

Linux Macbook Function Key Mode – fnmode

So, I couldn't figure out how to get my Macbook function keys to default to function keys under Linux, rather than media keys such as brightness, volume control, etc.  I searched all over the net for information on this feature, and could only find stuff about pb_fnmode (which doesn't appear in the latest kernels).  So, I finally resorted to grepping "fnmode" out of the sources, and found the location that sets this.  Then, I noticed that the kernel module that handles Mac key mappings had a parameter that could be changed, called "fnmode".  Well, that gave me a clue that it may be in /sys/ somehwere.  So, I searched, and sure enough, it was there.  The following command will set the function keys to be the default action, rather than media keys.

echo 2 > /sys/module/hid_apple/parameters/fnmode

The valid values are (0 = disabled, [1] = fkeyslast, 2 = fkeysfirst)

This effectively reverses the function key/media key mappings.

Comments (8) Trackbacks (0)
  1. Thanks for this note! It is one years old but it’s still working 🙂

  2. Thanks, very helpful!

    • Thanks, very helpful! To make it permanent, create a file called /etc/modprobe.d/apple.conf and put the line “options hid_apple fnmode=2” into it.

  3. still works 2 and a half years later (of course, my macbook is 5 and half years old)

    thanks

  4. great tip! thanks for sharing! 🙂

  5. Still works in 2014!

  6. Finally! A solution for the accursed Fn+F# key issue. Mac users touching an iSeries have lots of problems with this…

    Still works in late 2015 on Ubuntu 15.10 on a MBP.

  7. Every time I do a reinstall on a Mac I end up searching for how to fix this, then I end up on this post. Thanks for saving my sanity time and again.


Leave a comment

 

No trackbacks yet.