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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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