No such function in IntelliJ as of now. But there is an open source app that I use for this. You can configure how your F-keys behave per app. So you can set them as F1-F12 in IntelliJ and keep them as media control everywhere else. https://github.com/Pyroh/Fluor