13

I'm used to having the Control button at the bottom left corner of the keyboard. It's a little annoying to be pressing Fn + Tab when I wanted a Control + Tab and the position of the Control button in the new Mac keyboard layout is just very uncomfortable for any finger to reach.

Does anybody know how you can make the Control and Fn buttons change function like how you can change the modifier keys in System Preferences?

  • 6
    Does anyone know why on earth has Apple decided to do this? – mahdix Mar 30 '17 at 8:06
17
  1. Download and install Karabiner

  2. Open Karabiner Elements and set the Target Device in the dropdown

  3. Map fn to left_control and left_control to fn as below

    Karabiner Elements Map fn to control

| improve this answer | |
  • karabiner is great and does all things – theonlygusti Feb 20 '19 at 4:55
  • is apple a1243 or a1242 supported? – Alexander Myravjev Apr 28 at 1:17
9

Not sure which OS this started appearing in but in macOS 10.13, this can be customized in System Preferences > Keyboard > Modifier Keys:

System Preferences > Keyboard > Modifier Keys

| improve this answer | |
  • 10
    I'm running 10.13.3 but do not see the fn Key in the modifier key window. Was it removed again? – Spork Mar 27 '18 at 15:26
  • 7
    That's peculiar. I double checked, but see only 4 options. It also doesn't show up on google images for 'modifier keys' (the only exception being the image in this answer). Are you sure it isn't something you've installed? – Spork Apr 4 '18 at 7:43
  • 14
    Sadly this only works to map fn to ctrl but it's impossible to map ctrl to fn. – andresp Jul 2 '18 at 13:21
  • 1
    I'm in 10.14.2 and also only seeing 4 options (fn not being one of them). – rept Jan 7 '19 at 23:49
  • 2
    Apple doing it again, can remap fn to ctrl but not the otherway around, truly geniuses ahead of its time. – Ivan Castellanos Nov 24 '19 at 1:40
6

you can use KeyRemap4MacBook

http://pqrs.org/macosx/keyremap4macbook/

you can find the included prepared settings list at this address:

http://pqrs.org/macosx/keyremap4macbook/list.html.en

as you can see there is the setting for Fn Key

| improve this answer | |
  • Thank you! Worked like a charm. And it has many other useful settings, too! – radj Apr 16 '13 at 9:21
4

This is my white whale. I can't use Emacs without the control key being on the left hand side. Recently I got a new MacBook so I had a chance to do this without Karabiner.

This is what worked for me to rebind the function key to control (for the built-in keyboard only), on macOS 10.15.6.

hidutil property --matching '{ "ProductID": 0x027e }' --set '{
  "UserKeyMapping": [
    {
      "HIDKeyboardModifierMappingDst": 30064771300,
      "HIDKeyboardModifierMappingSrc": 1095216660483
    },
    {
      "HIDKeyboardModifierMappingDst": 30064771296,
      "HIDKeyboardModifierMappingSrc": 280379760050179
    }
  ]
}'

Verify it with hidutil property --matching '{ "ProductID": 0x027e }' --get "UserKeyMapping".

How I found these keycodes

I've both seen the option to change the Function (fn) Key and not seen the option to change the Function (fn) Key on the same computer, using the same version of macOS. Take it with a grain of salt, but I can consistently get the variant with the Function (fn) Key option to appear if I:

  1. Have an external keyboard attached, via a USB-Type C hub
  2. Open the Keyboard → Keyboard → Modifier Keys
  3. Lock the screen using the external keyboard
  4. Walk away for some time (wait until the computer sleeps)
  5. Wake the computer by pressing a key on the external keyboard and use Touch ID to log in
  6. Now the Modifier Keys preference has the Function (fn) Key option. While in this state, change the behaviour of the function key using the drop down list (I chose ^ Control)
  7. Copy ~/Library/Preferences/ByHost/.GlobalPreferences.${__UUID__}.plist (described here) somewhere else temporarily
  8. Convert the binary PList to XML: plutil -convert xml1 .GlobalPreferences.${__UUID__}.plist

Contents of that file are:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>com.apple.keyboard.modifiermapping.1452-638-0</key>
    <array>
        <dict>
            <key>HIDKeyboardModifierMappingDst</key>
            <integer>30064771300</integer>
            <key>HIDKeyboardModifierMappingSrc</key>
            <integer>1095216660483</integer>
        </dict>
        <dict>
            <key>HIDKeyboardModifierMappingDst</key>
            <real>30064771296</real>
            <key>HIDKeyboardModifierMappingSrc</key>
            <integer>280379760050179</integer>
        </dict>
    </array>
</dict>
</plist>

This page shows up if you search for these HIDKeyboardModifierMappingSrc and says that 1095216660483 is for the left function key, 280379760050179 is for the right.

I thought I was going crazy so I took some screenshots for proof:

Modifier Keys preference pane without the Function (fn) Key option

Modifier Keys preference pane without the Function (fn) Key

Modifier Keys preference pane with the Function (fn) Key option

Modifier Keys preference pane with the Function (fn) Key

About ProductID

You can find the Product ID associated with your keyboard using the System Report button: Apple menu → System Report → Hardware → USB.

If you use the --matching parameter to hidutil using a specific Product ID, the changes will affect that piece of hardware only. For example, maybe you want to change the layout of the built-in keyboard, but not an external one.

enter image description here

| improve this answer | |
  • Excellent post, thanks very much - this answer deserves to be much higher as it does exactly what is asked without the overhead of additional software. – geedoubleya Sep 5 at 20:21
  • Nice aswer! But it didn't work, unfortunately. Fn started to work as Ctrl, but kept also working as Fn, and Ctrl didn't work as Fn. I'm using the MacBook Pro 16 here, so it seems there is some hardwired stuff in this hardware, probably related to the touch bar. – BrunoJCM Sep 8 at 3:57
1

You could also add this to private.xml:

<autogen>__KeyToKey__ KeyCode::FN, KeyCode::CONTROL_L</autogen>
<autogen>__KeyToKey__ KeyCode::CONTROL_L, KeyCode::FN</autogen>

See the source for the key code values and predefined settings.

| improve this answer | |
1

I was happy, but then not as much. I just bought a Logitech K850 keyboard. Has a nice shape to help with wrist issues (for another time). Has keys from left as:

ctrl    fn    alt opt    cmd <butterfly>

Tried Karabiner but it didn't seem to work (tested by using ctrl-F in vi/vim). Then I found this document (https://pqrs.org/osx/karabiner/document.html) which lists a limitation.

Karabiner-Elements cannot modify the fn key on non Apple keyboards such as Logitech keyboards.

Not for Logitech. Ouch. Other suggestions? Back to best buy again? I'm really just looking for a mac layout keyboard with full size keys. I don't care about the num pad, etc. on right side. The K850 looked good except for this issue. Some gentle ergonomics help is good.

| improve this answer | |
  • This is more of a comment or new question than an answer. – dunxd Apr 27 at 14:19
  • I am still using the K850 after more than a year. Though I cannot swap the ctrl and fn keys, I am very happy with this keyboard. I've grown accustomed to the layout and the feel is "oh so much" better than the macbook air 2018 laptop keyboard. FYI. – Alan Carwile Apr 28 at 16:31

You must log in to answer this question.

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