Closed huntfx closed 3 years ago
Hi there Peter,
I'm afraid you passed the wrong argument.
get_battery_information
takes a user_index
(i.e. the index of the controller), so the correct way to call it would be:
XInput.get_battery_information(0)
About your question, I put that note there, because Microsoft recommends it.
For performance reasons, don't call XInputGetState for an 'empty' user slot every frame. We recommend that you space out checks for new controllers every few seconds instead. (Source)
Happy New Year! (:
Ah sorry my bad haha, I didn't notice it had a different input since nearly all the functions require the state.
Thanks for clarifying the connected function too, perhaps it'd be worth adding "for performance reasons" to the docstring, with a suggestion to not call it more than every few seconds.
Happy new year too :)
I was trying out the different functions available and came across this error:
Also can I ask what you mean by "You shouldn't check this too frequently" in
get_connected
? Is it just due to it being slow?