NameError: global name 'XINPUT_ERROR_SUCCESS' is not defined
First of all: Great thx for this lib. It just works and is so easy to use. Thank you!
When I ran my program a while, I suddenly got this error:
NameError: global name 'XINPUT_ERROR_SUCCESS' is not defined
Since it happened out of nowhere I cant give you a debugging hint. I run this lib on win7 with XBox One Controllers (works like a charm!)
Full traceback:
events = get_gamepad()
File "C:\Anaconda2\lib\site-packages\inputs.py", line 2713, in get_gamepad
return gamepad.read()
File "C:\Anaconda2\lib\site-packages\inputs.py", line 2101, in read
return next(iter(self))
File "C:\Anaconda2\lib\site-packages\inputs.py", line 2192, in __iter__
self.__check_state()
File "C:\Anaconda2\lib\site-packages\inputs.py", line 2199, in __check_state
state = self.__read_device()
File "C:\Anaconda2\lib\site-packages\inputs.py", line 2406, in __read_device
if res == XINPUT_ERROR_SUCCESS:
NameError: global name 'XINPUT_ERROR_SUCCESS' is not defined
Segmentation fault
Sorry for the delay in replying. Thanks so much for logging the error. XINPUT_ERROR_SUCCESS = 0 which is defined at line 139.
Therefore, on line 2406, it could just be replaced with if res == 0. When I get a chance to spool up Windows I will test and try to make the same error, and see if this fixes it.
Sounds good. Thank you!
Wow time flew. Sadly I cannot replicate this error. Can you?
Nope - This is 2 years old. I have no idea what that was :)