Closed daz closed 5 years ago
I tried out your test code and don't see that there is necessarily a problem. As this code is written, the while loop is running at an unconstrained speed, so a quick tap of the dpad registers dozens, if not hundreds of lines of output, filling the screen instantly.
By default, the Joystick class refreshes, at most, 30 times per second, or about every 33ms. As a result, a quick press of the dpad will appear to last 33ms, at a minimum. During that time, the unconstrained while loop has plenty of time to spill out many lines on screen.
I'd suggest you give 'sample.py', included in the repository, a try to get a good visual response on how things are working. If you are still seeing a stuck button issue, then I suggest you run xboxdrv interactively to see the exact output that is being interpreted by the xbox.py code. Just issue the following command from your linux console.
sudo xboxdrv --detach-kernel-driver
From the command line, running the below script:
And immediately tapping and releasing "down" on the dpad, results in an infinite stream of "dpad down" printed to stdout, until you tap another button. Anyone know a workaround?