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-2024.9.1.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

cc.xboxcontroller-2024.9.1-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file cc_xboxcontroller-2024.9.1.tar.gz.

File metadata

  • Download URL: cc_xboxcontroller-2024.9.1.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for cc_xboxcontroller-2024.9.1.tar.gz
Algorithm Hash digest
SHA256 1ada8c8916da9c44f1ba8fbf05342bb767b361ae3eddfbd6d8ba8f9ad1e66be8
MD5 4ac0174a3bf8f0121d612b18e302093c
BLAKE2b-256 1859200b205adc9f2d8692c1c8bcc755d954b6b382f251fa5b00ccb1b8b2de7a

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for cc.xboxcontroller-2024.9.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fc188cac34cbdbee8432f6409482f38edd3c21db20bca83d7f95fc9613f0854f
MD5 ca8181d32131f92ddd8734005c46c772
BLAKE2b-256 c3142da93d1ab867bb1d55bd9cc2d2f145fb6195277bea086f01ec8a4b61e3a7

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