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

[pygame] [BUG] Joystick.get_axis() alwauys return 0



Hi,
I'm trying to interface mine python script with the joystick and, even if I use an event approach, I would like to initialize the axes correctlty.
So trying to do this:
import pygame
pygame.joystick.init()
pygame.display.init()
myjoy = pygame.joystick.Joystick(pygame.joystick.get_count()-1)
myjoy.init()
pygame.event.pump()
numaxes=myjoy.get_numaxes()
myjoy.get_axis(2) #axis 2 is the throttle

I obtain always 0 value

SDL_JoystickGetAxis value:0:
0.0

What is wrong?
Thank you,
Xwang

PS I'm using Kubuntu 10.04 LTS2, python 2.6.5 and pygame 1.9.1