Mapping F-keys to specific actions in an app

I have good news and bad news.

The good news is that Karabiner Elements can do exactly what you want, for free. I use it for this very purpose.

The bad news is that to make it change the function keys for specific applications is a custom rule (what Karabiner calls a “complex modification”, and how to create these rules is non-trivial.

Update: I’d upload an example of a file that does function key changes, but Discord won’t let me. The only kind of file we can upload is PDF? The complex rules file is .JSON.