[Bug 376537] Re: Axes and Hats not read in PyGame/SDL 1.2
Please reply if this is still an issue on a supported release. ** Changed in: libsdl1.2 (Ubuntu) Status: New => Invalid -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/376537 Title: Axes and Hats not read in PyGame/SDL 1.2 To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/libsdl1.2/+bug/376537/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 376537] Re: Axes and Hats not read in PyGame/SDL 1.2
I am using pygame (which wraps SDL), and I have http://www.powera.com/Products/PROD_CTRLS/PLATFORM_PS3/CPFA051083 on a USB connection. pygame.joystick.Joystick.get_numaxes() returns 1, even though it should return 4. pygame.joystick.Joystick.get_numaxes() returns 0, even though it should return 1. The joystick responds to pygame.JOYAXISMOTION events when any joystick moves, however. The one axis that I do have control over (kind of) is the x axis on the left joystick When I press the hat down in any direction, I get a segmentation fault: "Fatal Python error: (pygame parachute) Segmentation Fault" That is probably related. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/376537 Title: Axes and Hats not read in PyGame/SDL 1.2 To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/libsdl1.2/+bug/376537/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 376537] Re: Axes and Hats not read in PyGame/SDL 1.2
Check which joystick device is being used. Perhaps SDL is using /dev/input/event* where it was using /dev/input/js0 previously. See also bug 410187. Could be something completely different, especially since event devices are supposed to give SDL *more* info about hats etc, not less, but worth checking. -- Axes and Hats not read in PyGame/SDL 1.2 https://bugs.launchpad.net/bugs/376537 You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 376537] Re: Axes and Hats not read in PyGame/SDL 1.2
Apparently only hats are broken. In the code above, I was checking for balls instead of axes. I corrected the code, and axes are still working fine. -- Axes and Hats not read in PyGame/SDL 1.2 https://bugs.launchpad.net/bugs/376537 You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 376537] Re: Axes and Hats not read in PyGame/SDL 1.2
... from pymikes email to the pygame mailing list... here's an SDL C program to show it's broken... Results of running the program on ubuntu listed below the code. #include "SDL/SDL.h" int main() { SDL_Init(SDL_INIT_JOYSTICK|SDL_INIT_VIDEO); SDL_SetVideoMode(640, 480, 32, SDL_SWSURFACE); SDL_Joystick *joy; joy = SDL_JoystickOpen(0); printf("Name of joystick: %s\n", SDL_JoystickName(0)); printf("Number of hats: %d\n", SDL_JoystickNumHats(joy)); printf("Number of buttons: %d\n", SDL_JoystickNumButtons(joy)); printf("Number of balls: %d\n", SDL_JoystickNumBalls(joy)); SDL_Event event; Uint8 hat_state; int running = 1; while( running ) { SDL_JoystickUpdate(); hat_state = SDL_JoystickGetHat(0, 0); if( hat_state == SDL_HAT_UP ) printf("Hat is pointing up"); while(SDL_PollEvent(&event)) { switch(event.type) { case SDL_QUIT: running = 0; break; case SDL_KEYDOWN: switch(event.key.keysym.sym) { case SDLK_ESCAPE: running = 0; break; default: break; } break; case SDL_JOYBUTTONDOWN: switch(event.jbutton.button) { case 1: printf("1 was pressed\n"); break; case 2: printf("2 was pressed\n"); break; } break; case SDL_JOYBUTTONUP: switch(event.jbutton.button) { case 1: printf("1 was released\n"); break; case 2: printf("2 was released\n"); break; } break; } } } SDL_Quit(); return 1; } Name of joystick: Logitech Logitech Dual Action Number of hats: 0 Number of buttons: 12 Number of balls: 0 1 was released 2 was released 1 was pressed 1 was released 2 was pressed 2 was released -- Axes and Hats not read in PyGame/SDL 1.2 https://bugs.launchpad.net/bugs/376537 You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 376537] Re: Axes and Hats not read in PyGame/SDL 1.2
hi, Here is a related thread on the SDL mailing list: http://thread.gmane.org/gmane.comp.lib.sdl/40019 It seems either linux or ubuntu has changed the numbers returned for different joystick functions... for no good reason. This breaks all SDL based games that use joysticks. cheers, -- Axes and Hats not read in PyGame/SDL 1.2 https://bugs.launchpad.net/bugs/376537 You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs