Sep-22-2018, 08:30 PM
(Sep-22-2018, 08:16 PM)Larz60+ Wrote: not a pygame expert, but it appears that in the code:
if event.type == pygame.JOYBUTTONDOWN: print("Joystick button pressed.") if event.type == pygame.JOYBUTTONUP: print("Joystick button released.")instead of just printing, call a function, for example:
if event.type == pygame.JOYBUTTONDOWN: process_button_down_stuff() if event.type == pygame.JOYBUTTONUP: process_button_up_stuff()
Hi Larz,
Thanks for the reply. What you have suggested would work, but isn’t specific to the pos and neg values. Is there a way, maybe here,
axes = joystick.get_numaxes() textPrint.print(screen, "Number of axes: {}".format(axes) ) textPrint.indent()Where I could say “If joystick no.1’s axis no.3 is 1, then print ‘hello!’”?
Cheers.