c++windowsxinput

How to get Game Controller name (Windows 10 / C++)


I've seen lots of info on how to read game controller input using XInput but I really want to know the name of the controller that is connected.

Game Controller

How can I find out the name of connected controllers on a PC or more specifically the name of the controller I am reading XInput from?


Solution

  • You can do this by calling the joyGetDevCaps function which returns a JOYCAPS structure containing all information (including name) of the connected controller.