[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Joystick is picked up but Joystick.get_button(n) and Joystick.get_axis(n) return 0.0



On Tue, 2006-07-18 at 15:28 +0100, Adam wrote:
> Python 2.4.1, pygame 1.7.1 linux kernel 2.6.17.6 logitech attack 3
> joystick. The joystick works in planet penguin racer and cat /dev/js0
> prints loads of rubbish as the joystick is moved or buttons are
> pressed but get_button and get_axis always return 0 whether the
> buttons are pressed or the axes are centralised or not. Is there
> anything I can do to fix this? 

You'll need to get events from pygame.event once in awhile to update the
joystick information (or call pygame.event.pump()).

Try the "eventlist.py" example program that comes with pygame. It will
show you what all the attached joysticks are doing as you use them.