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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file cc.xboxcontroller-2023.12.26.tar.gz
.
File metadata
- Download URL: cc.xboxcontroller-2023.12.26.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7eb54f38881e7be1f0e12f8081ce76d4303b38fadb0f0ec7870609dff51b4545 |
|
MD5 | d2278ccadc21b92712c45f2a667459b7 |
|
BLAKE2b-256 | 40f9c2fc066eee1c922c1610bb2d8d3728ea7bfa25d82e8c45f2cf92e076e81c |
Provenance
File details
Details for the file cc.xboxcontroller-2023.12.26-py3-none-any.whl
.
File metadata
- Download URL: cc.xboxcontroller-2023.12.26-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48a2425476615f4e0d31bd64eb3cf776d5fb0a53e17543c484df353e08881ad9 |
|
MD5 | bed7011c4b7bae555f212a2816bc8e44 |
|
BLAKE2b-256 | dbe9fac5f1defc7f7766b4fd31354c445923f0531bbede62b076b7745fe45b09 |