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
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c2dd9e76d67b9486bb6696b7e8048c15dfa50b2d496d36b213b3fba2c1c6deac
|
|
| MD5 |
dddf049a411efe70500ad73103d3e887
|
|
| BLAKE2b-256 |
60e88a08f4f34ae21c97a4d054e7b25ecb6dfcc477a65b5e9ba0ae8e7308e39a
|
File details
Details for the file cc.xboxcontroller-2024.9.2-py3-none-any.whl.
File metadata
- Download URL: cc.xboxcontroller-2024.9.2-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
142897c6635d018b69ba8cb6a21d7d4dd6a087b3317019a05d6ccc129eab8dcb
|
|
| MD5 |
6839db3c03a7acd432ae3367c1d727ec
|
|
| BLAKE2b-256 |
f367851bbbd34078ca0e78fe3d63ae36170089d60bb18bbb9caad17fad03a39c
|