Use F1, F2 etc. keys to control built-in Mac features when using an external USB keyboard
The fn key isn't a modifier that's sent to the OS, it modifies the scan code that is sent.

To test this out, you can use a built in utility called xev (requires X11) to view the scan codes being sent from your mouse and keyboard.  You can also use Karabiner's Event Viewer to to obtain the key press scan codes.

What this means is that the scan code for F1 (130) will be different from the scan code of fnF1 (107).  Keep in mind that macOS allows you to "lock" the fn key to a particular behavior (have the function keys act as normal function keys or act as the "special feature keys").

This is different from other modifier keys (like Shift or Option in that both scan codes are sent (i.e. Shift A sends 64 and 8).

As for remapping a keyboard, you can use the built in utility hidutil to remap keys.  This answer here can guide you on how to do that.


Apple Developer Documentation Key Table Usage
USB.org Key Usage Table Reference (Page 53) (more in-depth source for Apple's Table)


This is a bit of a workaround for a simple keyboard, and my preference would be to just purchase a cheap keyboard with the fn key functionality built in so everything works out of the box.