Jump to content
  • Advertisement
Sign in to follow this  
marshdabeachy

XInput - Detecting new controllers

This topic is 3722 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I was just curious if the XInput interface provided any kind of notification when a new controller becomes active. Obviously I could constantly poll for new controllers every frame, but that seems rather wasteful. I checked Microsoft's documentation but I didn't see anything. Anyone know of a magic function that provides this?

Share this post


Link to post
Share on other sites
Advertisement
I'm not aware of any way of doing it other than by polling every frame. It really isn't that much of an overhead to do so.

Course, you could probably get away with only polling once a second or something.

Share this post


Link to post
Share on other sites
I scan the unused indices to check for a new controller over many frames (1 controller every 4 or 5 frames). Why? When XInput was first introduced, it took several milliseconds to determine that controllers weren't attached, each frame. I'm not sure if it ever got fixed.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!