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, Axis

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

    while True:
        stick.update()
        stick.set_rumble(abs(stick.get_left_trigger()))
        stick.set_rumble(abs(stick.axes[Axis.RTrigger]))
        print("A Btn:", stick.get_a_button(), end="")
        print("\tD-pad:", stick.get_dpad(), end="")
        print("\tX Axis:", stick.get_left_x())
        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.2.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: cc_xboxcontroller-2024.9.2.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.2.tar.gz
Algorithm Hash digest
SHA256 c2dd9e76d67b9486bb6696b7e8048c15dfa50b2d496d36b213b3fba2c1c6deac
MD5 dddf049a411efe70500ad73103d3e887
BLAKE2b-256 60e88a08f4f34ae21c97a4d054e7b25ecb6dfcc477a65b5e9ba0ae8e7308e39a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cc.xboxcontroller-2024.9.2-py3-none-any.whl
Algorithm Hash digest
SHA256 142897c6635d018b69ba8cb6a21d7d4dd6a087b3317019a05d6ccc129eab8dcb
MD5 6839db3c03a7acd432ae3367c1d727ec
BLAKE2b-256 f367851bbbd34078ca0e78fe3d63ae36170089d60bb18bbb9caad17fad03a39c

See more details on using hashes here.

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