How do I check if PC player is using kb+m or an xinput controller?

I think a lot of games just check for controller inputs, and if it detects something then it changes to controller UI prompts.