There are several ways to organize this.
For example, if all players are instances of the same sprite or family, you can store control type in an instance variable. Then, in keyboard/gamepad events pick the player instance:
Keyboard On Space pressed
Players controlType="kbd" : Player simulate jump
Gamepad 0 on A pressed
Players controlType="gamepad1" : Player simulate jump
Gamepad 1 on A pressed
Players compare variable controlType="gamepad2" : Player simulate jump
To optimize this code you can create functions or custom actions for each movement - PlayerMoveLeft, PlayerMoveRight, PlayerJump etc. Then call these functions/custom_actions from keyboard and controller events:
Keyboard On Space pressed
Players controlType="kbd" : Player Jump
Gamepad 0 on A pressed
Players controlType="gamepad1" : Player Jump
Gamepad 1 on A pressed
Players controlType="gamepad1" : Player Jump
Player Custom Action Jump
Player simulate jump
Player set "jump" animation