@10vorne If you are using lr-fuse, there is some useful info here:
https://retropie.org.uk/docs/ZX-Spectrum/#controls
I use that to set the gamepad to act as a Kempston joystick then choose that in the game. So thats just editing the spectrum retroarch file in /opt/retropie/configs/zxspectrum/retroarch.cfg
For what its worth, here are some notes I scribbled some years ago
input_libretro_device_p1 = "513"
input_libretro_device_p2 = "0"
input_libretro_device_p3 = "259"
input_libretro_device_p4 = "1"
input_libretro_device_p5 = "1"
This sets the first player to Kempston and player 3 to keyboard
To choose controls when starting a game, press select to bring up the keyboard overlay
some games may need core option set per game to force 48k model for compatibility (like dizzy)