How to get or assign input "sources"

I am working on a project that has plans to be a local multiplayer experience, I was wondering if there was a way to get a PlayerControllers source so I could run code differently based on if the source is a controller or keyboard and mouse.

Any help would be appreciated.