I would like to be able to detect trigger frames independently of each other, but triggers seem to have one axis.
I didn't see anything on Xbox One controllers in MSDN docs, but for Xbox 360 controllers, DirectInput triggers use an axis, and XInput selects separate axes for each trigger. This suggests that pygame uses DirectInput, not Xinput, but I don't know how to get pygame to use Xinput instead.
(How) can I force pygame to use xinput instead of direct input? If this is not realistic, I would like to use a different language.
I use this script to read input from a controller:
import pygame pygame.init() screen = pygame.display.set_mode((400,400)) joysticks = [] for i in range(0, pygame.joystick.get_count()): joysticks.append(pygame.joystick.Joystick(i)) joysticks[-1].init() while True: for event in pygame.event.get(): print event
EDIT . I donβt have time to write this completely, but in the meantime I found this code that works for me (on the Xbox One Spectra controller): https://github.com/r4dian/Xbox-360-Controller-for- Python
source share