Workaround
Per @unknown's comment, it is possible to use external software to remap the keys. See that comment for more info.
The bug
Since 17w43a, the Function key can no longer be bound in controls in macOS. Previously, it could be bound and would show up as FUNCTION
.
How to reproduce
Go to
Options > Controls
.Select a control.
Press the Function key to try to bind the key to the control. Notice that nothing happens; the key press is ignored.
Related issues
is duplicated by
relates to
Comments


Why hasn't this been fixed yet? Still not fixed in pre-4.

Is this bug that difficult to fix? What should our mac users do? buy an external keyboard? Okay. If Mojang can't fix that. I have a solution to temporary fix this problem.
Install Karabiner
Enable Karabiner
Open file ~/.config/karabiner/karabiner.json
Insert following text into *“rules”: [ ]*
Save file.
Set sprint key to “=”, and use key ";" as "fn" key.
Enjoy and waiting for Mojang to fix it. (forever?)
{
"description": "Fn in Minecraft",
"manipulators": [{
"conditions": [{
"file_paths": ["/Applications/Minecraft.app/Contents/runtime/jre-x64/1.8.0_74/bin/java"],
"type": "frontmost_application_if"
}],
"from": {
"key_code": "fn"
},
"to": [{
"key_code": "equal_sign"
}],
"type": "basic"
},
{
"conditions": [{
"file_paths": ["/Applications/Minecraft.app/Contents/runtime/jre-x64/1.8.0_74/bin/java"],
"type": "frontmost_application_if"
}],
"from": {
"key_code": "semicolon",
"modifiers": {
"optional": ["any"]
}
},
"to": [{
"key_code": "fn"
}],
"type": "basic"
}
]
}

To my understanding, yes, it is a complicated one. Partially because of MC-29501, and partially because this is an issue in the library the game uses and not the game itself.

I hate to be that one guy; however, @Jinyu Meng's solution is not viable. While it does let us use the "FUNCTION" key as our sprint, it makes us have to reconfigure our Dual-Wielding key. Along with that, in most scenarios, we'll have to use both hands in order to toggle our #F-keys rather than 1 as before. Using this solution also prevents us from typing the letter "F" in chat, making this extremely annoying on multiplayer as well as when you're doing command work. Lastly, using Karabiner effects ALL versions of the game, not just the 1.13 Pre-releases; moreover, making this a temporary but not great work-around
Really hoping this is fixed before the final release!

Would @Jinyu Meng's solution also be applicable to MC-121376?

Are you going to fix it? I really can't play in 1.13 because of that issue..
Please do something about that

I changed the keys in my script to "=" and ";". These keys are not commonly use in chat or commands.

Still occurs in 19w02a

Still hasn't been fixed. Really annoying. Used the fn key for changing perspective.

Why can't it just be reverted to how it was before?

Also, it affects every version from 1.13 and up

I couldn't get @Jinyu Meng's code to work initially, so I changed in the file path from "/Applications/Minecraft.app/Contents/runtime/jre-x64/1.8.0_74/bin/java" to "/Application Support/minecraft/runtime/jre-x64/jre.bundle/Contents/"
Hope this helps to anyone out there!

I use the fn key to sprint but since I can't bind it to sprint in 1.16, I have to use control, but that hurts my finger and when I sprint with it, and my attack/destroy keybind (left mouse button) doesn't work when I sprint with control.
Can confirm in 21w07a.

Can this still be reproduced in 22w16b or later?

Yes, still applies to 22w16b

i can confirm in 1.19.4

Can confirm in 24w03b, but may be Works as Intended/Won't Fix. My understanding is that Apple doesn't intend for apps (generally) to be able to intercept the function key since doing so interferes with the behavior of F1, F2, etc, which is why any apps which do wish to intercept it must use a special workaround. The fact that Minecraft lacks such a workaround seems less like a bug and more like a choice to adhere to Apple's principles, annoying though they may be.
When will you fix this?It's very important to our Mac users. Use ctrl key to run will hurt our little finger.