How to handle multiple gamepads in new Input System?

Hi, I’m developing a game that’s going to have local multiplayer and I need to handle input from 4 gamepads (or 3 gamepads + keyboard). I did some research and found no ways of doing that with the new Input System.

I have InputActionMaps already set, but I can’t find a way to determine which of the gamepads sends the input. How can I do that?

I came across this question while seeking solutions to another problem.

Nevertheless, this video helped me when I had a problem like you - New Input System With Local Multiplayer in Unity - YouTube

You’ve probably already dealt with it. I paste the answer for others with this problem.