Magic Keyboard / Function Keys based on application

you can just use the send keyboard shortcut function for that (record the f keys using your keyboard/ touch bar)