pythoninputjoystickxbox

Xbox series controller input


I want to create a project that make controller text input and long story short, i need to listen for my right/left stick's direction(up, down, left, right) and XYAB buttons. thanks

i tried searching for python modules, but none were found for xbox series controllers


Solution

  • You can use an inputs module:

    from inputs import get_gamepad
    while 1:
         events = get_gamepad()
         for event in events:
             print(event.ev_type, event.code, event.state)
    

    This will get you started. For more information refer to the docs.