I use Keyboard2Joy with an autohotkey script to switch my IPAC mini "keyboard" into an xbox controller and back to keyboard after
https://gitlab.com/SchwingSK/Keyboard2Xinput
You can use the built in mode switcher by holding P1 start and a button (1,2,3,4) to switch modes instead, but this works seamlessly and is faster.
Using Keyboard2Joy I've set up various button mappings for different control layouts too eg: analog stick to digital joystick, twin stick etc.