Ask Your Question

Remap function keys so they don't require the "Fn" press

asked 2013-02-10 10:10:55 -0500

Dan Ross gravatar image

updated 2014-09-28 09:10:11 -0500

mether gravatar image

I'm using a Lenovo Ideapad s405 with Fedora 18. I switch between Gnome and Cinnamon currently.

I would like to flip the behavior of the f-keys. ie: require the "Fn" key to adjust brightness, volume, etc.

Having to press the "Fn" key to use plain F11 for example, is a real pain.

I've been searching and have yet to find a solution. There doesn't seem to be a setting in the BIOS either.

Any help would be appreciated.

edit retag flag offensive close merge delete


I have tried something similar in the past, but I think this endeavour is doomed.

You could try creating your own keymap and interchange the key values for F11 and fn + F11. As a first step try the xev program to get the key codes. After that try this.

imoj gravatar imageimoj ( 2014-04-19 05:59:52 -0500 )edit

4 Answers

Sort by ยป oldest newest most voted

answered 2015-02-07 14:40:12 -0500

mattingly890 gravatar image

As explained in the other answers, the following command will work temporarily:

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

However, to get this to become permanent (at least on Fedora 21), I had to create a persistent module as explained in the Fedora docs.

First, open a terminal as root, then cd into the /etc/sysconfig/modules/ directory. Then create a new module with:

touch fn_keys_fix.modules

The .modules ending on the filename is necessary here.

Open the file in your favorite editor, for example, nano;

nano fn_keys_fix.modules

And enter the following:

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

Save the file, and then make it executable:

chmod +x fn_keys_fix.modules

At the next reboot, your F-keys should be used as F-keys.

Note: I did not have success using echo "options hid_apple fnmode=2" > /etc/modprobe.d/50-hid_apple.conf as hinted at above (I don't think that this alone will actually do anything at boot, you'd have to use dracut).

edit flag offensive delete link more


Great answer. I can't vouch for it working on a Lenovo Ideapad as per the OP's question, but it worked for me on a MacBook Pro. Sorry I don't have enough points to upvote.

Bernie gravatar imageBernie ( 2016-03-21 17:05:45 -0500 )edit

On a Lenovo Flex 5 using Fedora 27, there is no directory /sys/module/hid_apple. However, there are other *hid*entries there, though none seem related. Suggestions?

wallyk gravatar imagewallyk ( 2017-11-25 12:52:28 -0500 )edit

answered 2014-11-27 11:29:44 -0500

philldo gravatar image

updated 2014-11-27 11:38:32 -0500

Not sure if this has been solved yet, but I'm answering because I came across this post while trying to troubleshoot.

I found the answer here:

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

  • 0 = disable Fn key completely
  • 1 = enable Fn key (shortcut keys first)
  • 2 = enable Fn key (F# keys first - F1-F12)

I have it set to 2 so I have to press the Fn key to use the keyboard shortcuts under the F# Keys

Hope that helps!

Edit: Note this is for the apple keyboards, obviously :)

edit flag offensive delete link more

answered 2016-09-02 08:56:24 -0500

@drwilkins had the right answer for me, with the persistent boot time option. I had to switch to root then echo out the config (option 2 in this case):

$ su root
# echo "options hid_apple fnmode=2" > /etc/modprobe.d/50-hid_apple.conf

Upon reboot, my fn-key was behaving as expected.

edit flag offensive delete link more

answered 2014-04-24 17:48:50 -0500

drwilkins gravatar image

I have configured my function keys on an Apple desktop keyboard (Linux PC though - I know it's a weird hardware combination!) in a similar way, so I'll post my solution here in case it leads you in the right direction.

You can change the behaviour of the keys at runtime to get the F1-F12 keys without pressing Fn using (as root)

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

Or alternatively, set it to 1 to get volume/etc. by default

To have it set automatically at boot time, I use:

echo "options hid_apple fnmode=0" > /etc/modprobe.d/50-hid_apple.conf

I'm guessing your Lenovo keyboard will have a similar kernel module that can be configured in a similar way.

edit flag offensive delete link more


This disables the Fn key... I think OP is looking for the reverse... which would be 'echo 2'.

philldo gravatar imagephilldo ( 2014-11-27 11:34:35 -0500 )edit

Question Tools


Asked: 2013-02-10 10:10:55 -0500

Seen: 10,360 times

Last updated: Feb 07 '15