Context
I have a MacBook Pro which I regularly "dock" via USB with a DisplayLink monitor. An external USB keyboard is attached to the DisplayLink monitor.
Whenever the laptop is docked I would like to use the USB keyboard with the F-keys acting as standard function keys (F1, F2, F3, etc...) without me having to press an Fn key.
However, when I use the laptop standalone I would like to use the built-in keyboard with the F-keys triggering their special functions (Mission Control, Volume, Brightness, etc...) without me having to press an Fn key.
Question
How can I make the functions key behave differently (normal vs special functions) based on the keyboard that is connected?
What I've tried
I already use Karabiner for other tasks and thought it would be a breeze to setup the desired behaviour. Unfortunately the checkbox which governs the F-key behaviour seems to be global. I tried setting the checkmark for the USB keyboard and off for the built-in keyboard, but it seems the last setting simply prevails, regardless of keyboard device.
I've also tried Fluor, but that tool uses the active application as the trigger to switch behaviour, not the connected keyboard.