Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How To Check If Controller Is Disconnected? #11

Open
michaelarts opened this issue Aug 14, 2020 · 1 comment
Open

How To Check If Controller Is Disconnected? #11

michaelarts opened this issue Aug 14, 2020 · 1 comment

Comments

@michaelarts
Copy link

Hey again,

I've got everything working great except one thing: how do we check if a controller is disconnected? Right now I'm calling JslConnectDevices() and JslGetConnectedDeviceHandles() every frame to see if there have been any changes to the device. However, this seems to cause problems with the DS4 lightbar, as each time I call those functions the color gets turned off.

Basically I'm looking for a way to call something like JslIsControllerActive(int deviceID), and if that returns false I'll call JslConnectDevices and JslGetConnectedDeviceHandles to find a new device.

Thanks, this library is super awesome!!

Michael

@JibbSmart
Copy link
Owner

Hi Michael! Thanks for checking it out. It's best not to be reconnecting every frame, but you could have a time-out on your end. If the call-back for a particular device hasn't been called for too long, then do the reconnecting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants