I'm working on my first win32 game and I'm currently programming the Input class. Now, the input class consists of a listener class that distributes messages and events to the classes that are attached to it. Basically, I have it so that my WndProc function passes keyboard and mouse events to the Input class, which then then distributes them to each listener attached to the input class. So in this regard, my program is complete and has full use of keyboard and mouse inputs.
My problem is that I'm trying to figure out a way to get Xbox 360 controller input using the XInput api. What I'd like to do is find a way to detect changes to my xbox 360 controller in my WndProc method just like I do for keyboard and mouse changes, but I'm not sure that this is even possible. Is there some sort of message like WM_KEYDOWN that the XInput api or Xbox 360 controller will send to WndProc? That way I can just pass the message to my Input class and listeners like I do other types of messages.
If this is not possible, is there some other way that I can detect when the state of the controller changes? I'd prefer to not have to poll each button on the face of the controller for each update, I'd much rather have the actual input to the controller drive the input process. I hope that my question is clear, if anyone has any questions I'd be happy to answer them. Unfortunately, the code project is quite big so posting samples is going to be very difficult.
Thank you in advance.