0

I'm using pygame to map values from my Logitech Cordless Rumblepad 2 and when i try to pull values from the right/left trigger buttons I can only retrieve binary values of 1-0 for button state down and up. Am I mistaken in thinking that the trigger buttons can retrieve inclusive values between 0 and 1? If not, how can I get this larger set of values? My code is below:

elif event.type == pygame.JOYBUTTONDOWN:
                if event.button == 6:
                    left = joysticks[event.joy].get_button(6)
                    print("Joystick",joysticks[event.joy].get_name(),": ", left)
  • A button is by default dump and you have to build logic around it in a controller.. If you press the switch in the button two wires get connected. No press => No current = 0 Pressed = current = 1 (digital registration). Registration of analogue values range from 0-24 volt. max. and thus may have different values depending on the controller logic behind it. You can find out by searching for control schematics at logitech site or open-up your device to find out... – ZF007 Mar 03 '18 at 12:27
  • Looks like you're after the joystick axis position, so you need to catch `JOYAXISMOTION` events and the [axis position](https://www.pygame.org/docs/ref/joystick.html#pygame.joystick.Joystick.get_axis) will be a floating point value between -1 and 1. – import random Mar 06 '18 at 01:53

0 Answers0