zeth / inputs

Cross-platform Python support for keyboards, mice and gamepads
BSD 3-Clause "New" or "Revised" License
269 stars 87 forks source link

Trigger buttons/Dpad not recorded as events #110

Closed miles-1 closed 1 year ago

miles-1 commented 1 year ago

Small problem, but not a massive issue. Using an Xbox Wireless Controller connected via Bluetooth in Windows 10, L&R bumpers are logged in the code below, but the L&R triggers give no response. Same with Dpad.

from inputs import get_gamepad

def main():
    """Just print out some event infomation when the gamepad is used."""
    try:
        while 1:
            events = get_gamepad()
            for event in events:
                if event.ev_type == "Key":
                    print(event.ev_type, event.code, event.state)
    except KeyboardInterrupt:
        pass

if __name__ == "__main__":
    main()

This is a super useful module & thanks to the developers for maintaining it.

miles-1 commented 1 year ago

Sorry, didn't realize that triggers & dpad show up in "absolute", not "key".