Dual configuration (keyboard- - joystick) per game


I want to be able to play all games with keyboard or joystick. But theres a problem…

In Retroarch input i can input player 1 binds, and then in emulator input, i can swap if necessary

But then, if i swap buttons on the joystick it changes the layout of the keyboard too, so If i configure one thing , the other get messy

I want to know if i can configure an input bind per game, apart of the control swap of the emulators, because when you do swap, you dont have separate swaps for keyboard and joystick (player 1) so if you swap you will mess the control layout of the other device. (or in other games).