Skip to main content

Getting input from Microsoft XBox 360 controllers via the XInput library on Windows.

Project description

cc.XboxController

Getting input from Microsoft XBox 360 controllers via the XInput library on Windows.

Installation

pip install cc-xboxcontroller

Usage

import time

from cc.xboxcontroller import XboxController, Hand

def main():
    """
    """
    stick = XboxController(0)

    while True:
        stick.update()
        stick.setRumble(Hand.LEFT, abs(stick.axes["LTrigger"]))
        stick.setRumble(Hand.RIGHT, abs(stick.axes["RTrigger"]))
        print("A Btn:", stick.getAButton(), end="")
        print("\tD-pad:", stick.getDPad(), end="")
        print("\tX Axis:", stick.getX(Hand.LEFT))
        time.sleep(.01)


if __name__ == "__main__":
    main()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cc.xboxcontroller-2023.12.26.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

cc.xboxcontroller-2023.12.26-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file cc.xboxcontroller-2023.12.26.tar.gz.

File metadata

File hashes

Hashes for cc.xboxcontroller-2023.12.26.tar.gz
Algorithm Hash digest
SHA256 7eb54f38881e7be1f0e12f8081ce76d4303b38fadb0f0ec7870609dff51b4545
MD5 d2278ccadc21b92712c45f2a667459b7
BLAKE2b-256 40f9c2fc066eee1c922c1610bb2d8d3728ea7bfa25d82e8c45f2cf92e076e81c

See more details on using hashes here.

Provenance

File details

Details for the file cc.xboxcontroller-2023.12.26-py3-none-any.whl.

File metadata

File hashes

Hashes for cc.xboxcontroller-2023.12.26-py3-none-any.whl
Algorithm Hash digest
SHA256 48a2425476615f4e0d31bd64eb3cf776d5fb0a53e17543c484df353e08881ad9
MD5 bed7011c4b7bae555f212a2816bc8e44
BLAKE2b-256 dbe9fac5f1defc7f7766b4fd31354c445923f0531bbede62b076b7745fe45b09

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page