Skip to main content

This module allows for accessing the current state of a connected Xbox controller on Windows via the XInput library(https://learn.microsoft.com/en-gb/windows/win32/xinput/getting-started-with-xinput?redirectedfrom=MSDN#getting-controller-state).

Project description

# pyxboxcontroller This module allows for accessing the current state of a connected Xbox controller via the [XInput library](https://learn.microsoft.com/en-gb/windows/win32/xinput/getting-started-with-xinput?redirectedfrom=MSDN#getting-controller-state) on Windows.

## Installation Simply install using pip pip install pyxboxcontroller

## Connect to controller Connect to the controller with id (starting at 0) using: controller = XboxController(id) ## Getting the current state of the controller The current state of the controller can be gotten with: state:XboxControllerState = controller.state This returns a XboxControllerState object.

Some examples of accessing the states’ values: left_thumbstick_x:float = state.l_thumb_x ` right_thumbstick_y:float = state.r_thumb_y` ` x_pressed:bool = state.x` ` lb_pressed:bool = state.lb`

Alternately buttons can be gotten with: ` button_pressed:bool = state.buttons[“button”]`

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

pyxboxcontroller-0.1.1.tar.gz (4.6 kB view details)

Uploaded Source

File details

Details for the file pyxboxcontroller-0.1.1.tar.gz.

File metadata

  • Download URL: pyxboxcontroller-0.1.1.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for pyxboxcontroller-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e7d24cdf12c40e976dc36d7af56007968ba578f004577a5276948a02a931fc58
MD5 89a57f2ea784720612d0f2c6148c5283
BLAKE2b-256 17ad78ad68289349f5042d1add49bbc2150236fb049ba4499747260a4660628b

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