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
Close
Hashes for cc_xboxcontroller-2024.9.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2dd9e76d67b9486bb6696b7e8048c15dfa50b2d496d36b213b3fba2c1c6deac |
|
MD5 | dddf049a411efe70500ad73103d3e887 |
|
BLAKE2b-256 | 60e88a08f4f34ae21c97a4d054e7b25ecb6dfcc477a65b5e9ba0ae8e7308e39a |
Close
Hashes for cc.xboxcontroller-2024.9.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 142897c6635d018b69ba8cb6a21d7d4dd6a087b3317019a05d6ccc129eab8dcb |
|
MD5 | 6839db3c03a7acd432ae3367c1d727ec |
|
BLAKE2b-256 | f367851bbbd34078ca0e78fe3d63ae36170089d60bb18bbb9caad17fad03a39c |