A colleague of mine found this node in the Input Device Subsystem :
The node is called Get Most Recently Used Hardware Device and it returns a struct which can be broken. The Enum inside that struct can be used in a select or switch, or whatever kind of node you want to filter that enum by and from there on just do what you want with the result of that enum.
In the case showed in the screenshot I’m selecting an input mapping depending on the kind of input, so for Keyboard and Mouse I’m using the Spacebar and for Gamepad I’m using Gamepad Face Button Right.